-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[react-query] type error for infinity query defaults in QueryClient #8218
Comments
Hi @aizerin as far as I can see, You might wanna use one of these: |
I know, and I think this is wrong. Defaults for infinity query should be included in types (as they were in react-query v4). It also works at runtime. |
Ok, then it is kinda inconsistency because the implementation differs from its typings. |
we moved infinite query types into their own interface because query/packages/query-core/src/types.ts Lines 410 to 425 in 18953be
It therefore doesn’t really make sense to set it globally (you’ll get an error on We could add it as |
I have several infinity queries with the same |
Describe the bug
I recently migrated from react-query v4 and this code now reports typescript error.
It does not accept values for infinite query.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/jtqm8f
Steps to reproduce
Just write this code
Expected behavior
Typescript should be happy
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Any
Tanstack Query adapter
react-query
TanStack Query version
5.59.16
TypeScript version
5.6.3
Additional context
No response
The text was updated successfully, but these errors were encountered: