queryOptions not persisted during the hydration/dehydration process
Is there any reason why the below hydration method (and also the dehydration method) does not persist options like
gcTime and staleTime?
Seems like it only does it for queryKey, queryHash, and meta.
This causes some issues in TS Start when defining queries with custom options on the server as those completely get lost on the client.
https://codesandbox.io/p/github/andyabih/tmp-start-query-options/main
You can check this here. If you go to the test query tab, do a refresh and start incrementing, you'll notice options reset to the default (30,000 gc for example).
Happy to dive into this deeper with either an issue or a PR, just want to understand if this is expected behavior or an actual issue.
Thanks!
2 Replies
conscious-sapphire•6mo ago
can you please create a GitHub issue for this so we can track this
ratty-blushOP•6mo ago
GitHub
Query options not persisted during hydration/dehydration · Issue #...
Describe the bug Setting query options like gcTime or staleTime seem to get lost on the client and replaced with default values after hydration. Your minimal, reproducible example https://codesandb...