-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
The duplicate keys check occurs prior to default options being set on the queries which generates the queryHash.
The below contains 2 unique query key's. However the duplicate keys warning logs since these queries are checked as-is and they do not yet have a queryHash.
const observer = new QueriesObserver(queryClient, [ { queryKey: [ 'Hippo', 'Layout', 'detail', 'id1', ], }, { queryKey: [ 'Hippo', 'Layout', 'detail', 'id2', ], }, ])
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/55fr36
Steps to reproduce
- Create a QueryObserver instance with 2 queries with 2 unique keys. Do not provide a custom queryHash.
- View the warning in your console
(CTA set up to do this for you in the codesandbox)
Expected behavior
We expect unique keys to not throw a duplicate key console warning.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
All
Tanstack Query adapter
None
TanStack Query version
v5.62.7
TypeScript version
No response
Additional context
No response
robertsargent
Metadata
Metadata
Assignees
Labels
No labels