Replies: 1 comment 3 replies
-
use deterministic query keys which communicate that they all belong together and use the fuzzy matching to invalidate at once:
alternatively, I think you could disable |
Beta Was this translation helpful? Give feedback.
3 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.
-
In one of my components I fetch data from 3, dependant, queries:
That works as expected. However, in an editor, in another window, I modify data in
a
query and I would like to invalidate it:queryClient.invalidateQueries("a")
As expected
a
gets invalidated and the data is refetched. However,b
andc
are not so they both would still return data that relies on the old instance ofa
.The only solution I have now is to invalidate ALL the dependant queries:
Not only do I need to specify them all, but I also need to specify them in a very specific order. If I invalidate
c
beforea
the resultinguseQuery
would run immediately and incorrectly cache inc
the old value ofa
.Is there a better solution?
Beta Was this translation helpful? Give feedback.
All reactions