Does partial matching apply to query keys?
For invalidateQueries, do query keys just need to meet the subset of query keys or must it be exact.
For example, if i have two queries that have the following queryKeys: ['hello'] and ['hello', 'world'] would invalidating ['hello'] invalidate both of the queries? I assume not since queryKeys are hashed at some point?
4 Replies
protestant-coral•17mo ago
Filters | TanStack Query React Docs
Some methods within TanStack Query accept a QueryFilters or MutationFilters object.
Query Filters
protestant-coral•17mo ago
queryKeys are hierarchal, so yes invalidating ['hello'] also invalidates ['hello', 'world']ambitious-aquaOP•17mo ago
Tysm!
protestant-coral•17mo ago
To be clear, unless you use
exact: true then yes they both invalidate