Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

InfiniteQueryOptions should omit initialPageParam and getNextPageParam #156

Open
JonasPf opened this issue Oct 2, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@JonasPf
Copy link

JonasPf commented Oct 2, 2024

Describe the bug

The code generator generates infinite query options like this:

Omit<UseInfiniteQueryOptions<TData, TError>, "queryKey" | "queryFn">

While this works for normal queries, it does not work for infinite queries because it enforces a type for options with initialPageParam and getNextPageParam as required attributes.

To Reproduce

Run pnpm generate:api in examples/react-app and look at /openapi/queries/infiniteQueryes.ts

OpenAPI spec file

See examples

Expected behavior

It should generate it like this:

Omit<UseInfiniteQueryOptions<TData, TError>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">
@7nohe 7nohe added the bug Something isn't working label Oct 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants