Replies: 1 comment
-
Hi, @bannndi! You're looking for a direct update through queryClient.setQueryData(). There are two main approaches to update the cache after a mutation (post, put, patch, delete...):
So instead of using a query invalidation, you can apply this direct update like this:
I hope this helps you. |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys!
Is there effective way (or even possible) to skip query request only for one or several mutation actions ?
`
Parent
query = useQuery(requestFn)
// Parent has shared state/logic with child
Child
Button onClick={post**(or put/patch)**.mutate()} // When clicked on button I want query in Parent to be skipped, because post response already has needed json data. All other times I want query to work as usual.
Child
Parent
`
Had some experiments with queryClient.setQueryData(), MutationCache.state, query.enabled.
Beta Was this translation helpful? Give feedback.
All reactions