-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
Describe the bug
If I type my query key as per the docs (https://tanstack.com/query/latest/docs/framework/react/typescript#typing-query-and-mutation-keys), matchQuery
expects a full query key instead of a partial query key (even if the exact
option of the QueryFilters is false
.
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-49gqkj84?file=src%2Fmain.tsx,src%2FApp.tsx
Steps to reproduce
- Type the query keys as per the docs (https://tanstack.com/query/latest/docs/framework/react/typescript#typing-query-and-mutation-keys)
- Try to use a partial key with
matchQuery
Expected behavior
If exact
isn't true (I believe this is the default), I would expect that I would be able to use a partial query key for the QueryFilter passed to matchQuery
instead of having to pass a complete key.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
N/A
Tanstack Query adapter
react-query
TanStack Query version
5.90.2
TypeScript version
5.4.5
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels