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
308 stars 31 forks source link

Support customizing `initialPageParam` #141

Closed adamgoose closed 2 months ago

adamgoose commented 3 months ago

Is your feature request related to a problem? Please describe. The newly added Infinite Query support generates a hard-coded initialPageParam: 1. This prevents use with cursor-based or zero-indexed pagination APIs.

Describe the solution you'd like Support customizing the initialPageParam, be it null, string, or number.

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.

ekuzu commented 2 months ago

Hi Guys

I uses 1.6.1, if i don't set initialPageParam in cli, It sends query page param as "initialPageParam" rather then default value 1

api/customers?page=initialPageParam&limit=10&search=

If it works like this please update the README

Thanks.

7nohe commented 2 months ago

Hi Guys

I uses 1.6.1, if i don't set initialPageParam in cli, It sends query page param as "initialPageParam" rather then default value 1

api/customers?page=initialPageParam&limit=10&search=

If it works like this please update the README

Thanks.

This issue is expected to be resolved in #149.