openapi-react-query-codegen
openapi-react-query-codegen copied to clipboard
InfiniteQueryOptions should omit `initialPageParam` and `getNextPageParam`
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">