openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

InfiniteQueryOptions should omit `initialPageParam` and `getNextPageParam`

Open JonasPf opened this issue 4 months ago • 0 comments

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">

JonasPf avatar Oct 02 '24 11:10 JonasPf