openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

Infer Return Type for `select` from `useInfiniteQuery`

Open awmichel opened this issue 9 months ago • 2 comments

Changes

Updates the types for useInfiniteQuery to infer the return type from the select option, if provided. Adds onto #2105 with recent addition of #2117.

Also adds the docs for useInfiniteQuery to the navigation in the docs site, it wasn't being linked to, and adds a note about customizing the query param name for pagination.

How to Review

See previous PR for the type inference in #2105 and additional test added to the useInfiniteQuery suite to check the return type is correctly inferred and functionally sound from useInfiniteQuery.

Checklist

  • [x] Unit tests updated
  • [x] docs/ updated (if necessary)
  • [ ] pnpm run update:examples run (only applicable for openapi-typescript)

awmichel avatar Feb 24 '25 23:02 awmichel

Deploy Preview for openapi-ts failed.

Name Link
Latest commit 3c7008940ca6c8d3a22ddb9056e6651b393f2bd1
Latest deploy log https://app.netlify.com/projects/openapi-ts/deploys/681400905592a00008b6ca47

netlify[bot] avatar Feb 24 '25 23:02 netlify[bot]

🦋 Changeset detected

Latest commit: 3c7008940ca6c8d3a22ddb9056e6651b393f2bd1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-react-query Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Feb 24 '25 23:02 changeset-bot[bot]

Freshly rebased on main. Who is the best reviewer for this change? Maybe @drwpow or @kerwanp?

awmichel avatar May 01 '25 23:05 awmichel