-
-
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
pageParam missing from default queryFn typescript definition #6715
Comments
we wanted to avoid having |
I can have a look yes ! |
@TkDodo shouldn't we have two default functions instead? One for the normal query and one for the infinite one ? |
I'm also running into this as well :) would be nice of course to fix/extend the typescript definition QueryFunctionContext for useInfiniteQuery to include the extra parameters it received, pageParam most important haha. |
that's not possible. There is only one |
I'm also running into this as well :) what can we do in the meanwhile? |
Describe the bug
pageParam used to be available in the default queryFn parameter options.
It is still passed (it is working correctly with //@ts-ignore), but typescript is reporting the following error when using it:
Property 'pageParam' does not exist on type '{ queryKey: QueryKey; signal: AbortSignal; meta: Record<string, unknown> | undefined; }'
Your minimal, reproducible example
https://tanstack.com/
Steps to reproduce
Expected behavior
pageParam is present in the typescript definition
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
all
Tanstack Query adapter
react-query
TanStack Query version
5.17.12
TypeScript version
4.9.5
Additional context
No response
The text was updated successfully, but these errors were encountered: