Skip to content
Discussion options

You must be logged in to vote

queryClient.setQueryData is for that use-case. You can just call it after the mutation to update the cache. It's described here: https://react-query.tanstack.com/guides/updates-from-mutation-responses

be aware that infinite queries have a different structure (pages and pageParams) that you need to keep with your direct cache maniuplation.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@branlok
Comment options

Answer selected by branlok
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