Skip to content

Avoid double fetch when query is prefetched and errors? #8995

Answered by TkDodo
C-Higgins asked this question in Q&A
Discussion options

You must be logged in to vote

that consumer has seemingly no way of knowing that the prefetch failed

that's very likely not what's happening. The query fails and it's put into an error state. But when the consumer mounts, it sees the error, sees that there is no data and puts the query back into pending state and triggers a refetch. That's the expected default behavior. Error'd queries are always stale.

you can set retryOnMount: false to change that.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@C-Higgins
Comment options

@TkDodo
Comment options

Answer selected by C-Higgins
@C-Higgins
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants