@kubb/plugin-react-query: Support nextParam and previousParam in Infinite query with nested field support #1814
Closed
davidsonalencar
started this conversation in
Ideas
Replies: 1 comment
-
Created a issue #1815 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request
In the current
Infinite
type under@kubb/plugin-react-query
, we only havequeryParam
and (optionally) acursorParam
. It would be helpful to support bothnextParam
andpreviousParam
separately for more flexible pagination handling, especially in APIs that provide both directions.Proposed enhancement
Extend the
Infinite
type to include:'data.next.id'
or['data', 'next', 'id']
.Why this matters
Many paginated APIs return both next and previous cursors, and being able to access them independently — especially when they’re nested — would improve the usability and adaptability of the useInfiniteQuery config generation.
Example use case:
With:
This would allow codegen to correctly extract the right cursor depending on direction and aligns with how
getNextPageParam
andgetPreviousPageParam
are used in TanStack Query.Beta Was this translation helpful? Give feedback.
All reactions