Replies: 3 comments 12 replies
-
Hi @digistaal, does the query key design pose any challenge with invalidation? The idea is you could invalidate on ANY level, but obviously it's not quite the same as the links you shared. A better starting point would be to look at issues you're facing and go from there? |
Beta Was this translation helpful? Give feedback.
-
You can use the queryKey generator functions to generate the query keys to invalidate |
Beta Was this translation helpful? Give feedback.
-
I would second what everyone else has discussed. Everything else with the plugin is making sense so far, but the querykey part is a little un-intuitive overall. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi community,
I noticed that the queryKey that's being generated for the @TanStack/Query plugin is an array with one object as an entry. This object contains an id, baseUrl and some information about params. I was wondering why these generated queryKeys don't follow the best practise of the identifier of your query being spread out as an hierarchal array instead of an object. Currently because of this design, invalidation of the queries works a bit different than the package designed it to. Normally queries can be invalidated on a higher level by only providing the first queryKey array's entry and can specify a more specific query by supplying more entries of this queryKey.
See the @TanStack/Query docs and this blog regarding best practises for more information.
Really curious about the reasoning behind this, please let me know!
Beta Was this translation helpful? Give feedback.
All reactions