mutate a useQuery result, the proper way #7931
Unanswered
Jurek-Raben
asked this question in
Q&A
Replies: 1 comment
-
it's just this: https://tanstack.com/query/latest/docs/framework/react/guides/updates-from-mutation-responses#updates-from-mutation-responses mutations don't need a key btw |
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.
-
Hi,
how do I properly remove an entry from a query result and update the query state/cache?
Currently I use a useQuery definition with querykey "key1". Then later I use a useMutation definition with a different mutationKey "key2". Inside the mutation I remove the entry from the data/array and then updating the query cache of "key1". But this feels like a hack.
Loose example:
Is there a proper way to somehow mutate the data of "key1"? Couldn't get my head around the documentation, infos about mutations seem to be spread over several sections and never seem to be complete either...
Beta Was this translation helpful? Give feedback.
All reactions