redux-toolkit
redux-toolkit copied to clipboard
There is no way to identify if there was an error in first try for rtk query
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.