-
Say I have a query for a list of todos (
Curious if anyone's come up with solutions/patterns for this. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think you an achieve that by writing to the cache in
it would also work the other way around: onSuccess of the list query, you create a bunch of detail query entries.
for that to work, an underlying schema would be needed that react-query doesn't have. queries and mutations don't know what they are actually doing. the best thing you can do is invalidate everything and let the smart refetching decide what it needs to refetch, or update after the mutation manually with the code shown above. |
Beta Was this translation helpful? Give feedback.
I think you an achieve that by writing to the cache in
onSuccess
, something like:it would also work the other way around: onSuccess of the list query, you create a bunch of detail query entries.
for that to work, an underlying schema would be needed that react-query doesn't have. queries and mutations don't know what they are actually do…