Describe the bug#
I saw this tweet:
https://x.com/TkDodo/status/1744604450566680864
queryClient.invalidateQueries({
predicate: query =>
matchQuery(['comments']) || matchQuery(['likes'])
})
matchQuery can be imported from RQ
So I tried searching matchQuery in the docs but nothing was found. Shouldn't this be mentioned somewhere?
Edit:
I also found usage of matchQuery in this article:
https://tkdodo.eu/blog/automatic-query-invalidation-after-mutations#use-the-meta-option
but the usage is a little bit different:
matchQuery({ queryKey }, query)
Your minimal, reproducible example#
...
Steps to reproduce#
- Go to the docs
- Search for
matchQuery
- No results are found
Expected behavior#
I'd expect matchQuery to be documented.
How often does this bug happen?#
None
Screenshots or Videos#
No response
Platform#
docs
Tanstack Query adapter#
None
TanStack Query version#
latest
TypeScript version#
No response
Additional context#
No response
the syntax in the tweet is wrong.
please make a PR and add it to this page: https://tanstack.com/query/latest/docs/framework/react/guides/filters