Replies: 1 comment
-
The only thing that comes to mind right now would be to have everything that should be invalidated together start with the same queryKey to enable the fuzzy matching. in your example, that would be: - ["user.matches", userID]
+ ["matches", "user", userID]
of course, if you have a second mutation that would need to invalidate all "user" related things, this doesn't work anymore - so it only works "one way" |
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.
-
We successfully integrated
react-query
in our constantly growing frontend codebase sincev1
with great success!Over the recent months, as our codebase is becoming more and more complex from sprint to sprint, we encounter more and more bugs due to missing cache invalidations after a successful mutation result, which the author accidentally forget or didn't think about.
The way how we handle cache invalidations after successful mutations looks often like this:
Are there some common practices or strategies to mitigate missing cache invalidations?
I'm also unsure if we only encounter those issues due to some way of carelessness of our developers, or if this is a common problem with growing frontend complexity.
Beta Was this translation helpful? Give feedback.
All reactions