redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

There is no way to identify if there was an error in first try for rtk query

Open heypran opened this issue 3 years ago • 1 comments

Background: RTK query provides built-in exponential retry ( default value 5). The doc mentions one parameter to control retries which is maxRetries which requires the query to be wrapped with retry utility. This works fine.

Issue: However, when the first request fails, the query status remains pending, isFetching is true and isError state is still set to false. In this case, there is no way to know whether query is retrying or fetching for the first time or in other words there is no way to if there was an error in first try.

heypran avatar Nov 29 '21 11:11 heypran