Replies: 2 comments
-
What it does is: if a query is in error state and you mount a new query, do you want to start fetching again or keep showing the error? This is different from “retry” in the classic react-query sense where a query keeps being in |
Beta Was this translation helpful? Give feedback.
0 replies
-
Fair enough, but the point still stands. Whether I want to refetch on mount could depend what the error is, for similar reasons to `retry`. For instance if it's a 404 and I know refetching won't change that.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The
retry
property supports passing a function so that we can determine whether an error is retryable. However,retryOnMount
can only be a boolean, which means the only options are to never retry or to always retry, even if the error wasn't retryable in the first place.2 possible solutions come to mind:
retryOnMount
to be a function. This would be the most flexible but potentially lead to duplicate logic since probably in 99% of cases we'd want it to be the same logic asretry
.retryOnMount
respectretry
and not retry if it returns false. This could be opt-in for backwards compatibility via a type along the lines ofboolean | 'auto'
.Beta Was this translation helpful? Give feedback.
All reactions