-
Notifications
You must be signed in to change notification settings - Fork 34
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
Property 'pageParam' does not exist on type '{ queryKey: QueryKey; signal: AbortSignal; meta: Record<string, unknown> | undefined; #89
Comments
Any updates? |
Also experiencing this error. I believe the type definitions of QueryKeyFactory need to be updated to have signal be optional |
I'm facing the same bug |
This is causing issues with other config properties ( |
I fixed the problem migrating to the latest version of RQ. the v5 |
@apenab could you show your RQ and query-key-factory versions please? |
The same problem. I have latest versions With typescript I can't use query keys factory without errors. Here is example: const exampleQueries = createQueryKeys('example', {
list: ({ id, ...params }: ExampleParams) => ({
queryKey: [id, params],
queryFn: (ctx) =>
axios.get(`example/${id}/list`, {
params: {
...params,
page: ctx.pageParam,
}
}),
}),
});
const id = '123';
useInfiniteQuery({
queryKey: exampleQueries.list(id).queryKey,
queryFn: exampleQueries.list(id).queryFn, // TypeScript error: Type number is not assignable to type never
initialPageParam: 1,
getNextPageParam: ({ page }) => (page + 1),
}); |
Hi
I'm trying to use
createQueryKeys
withuseInfiniteQuery
when use
ctx.pageParam
type error occurredError Message
my Code is here
is there any way to use
createQueryKeys
withuseInfiniteQuery
The text was updated successfully, but these errors were encountered: