7nohe / openapi-react-query-codegen

OpenAPI React Query Codegen is a code generator for creating React Query (also known as TanStack Query) hooks based on your OpenAPI schema.
https://openapi-react-query-codegen.vercel.app
MIT License
298 stars 30 forks source link

Support nested `nextPageParam` values #142

Closed adamgoose closed 2 months ago

adamgoose commented 2 months ago

Is your feature request related to a problem? Please describe. My API returns the nextPageParam as meta.next. Passing --nextPageParam meta.next results in broken typescript generation as local variables don't support dots.

getNextPageParam: response => (response as { meta.next: number }).meta.next

Describe the solution you'd like Support dots in the nextPageParam name and traverse the response accordingly.

Describe alternatives you've considered I'll have to manually define the infinite query in the meantime, utilizing the generated API client.

7nohe commented 2 months ago

It should have been resolved in v1.6.1.