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

Adding support for nested nextPageParam keys #144

Closed adamgoose closed 2 months ago

adamgoose commented 2 months ago

When nextPageParam is set to meta.nextPage, split on . and generate the appropriately nested typehint:

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

Fixes #142.

adamgoose commented 2 months ago

Closed in favor of #143