Skip to content
Discussion options

You must be logged in to vote

So after looking at that codesandbox, I can confirm that this is actually intended behavior. initialData on it's own is not enough to keep the query from refetching when it mounts, since initialData's main purpose is to allow you to set data that is available during SSR, and that's it. Once the query mounts, its default behavior is to refetch the data again.

The recommended way to stop the query from automatically doing anything at any time, is to set manual to true. Toggling a query's manual state after the fact won't trigger a refetch, so you can use it to reliably pause a query's auto refetching functionality as I have shown in this codesandbox example:

https://codesandbox.io/s/jovial-…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tannerlinsley
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants