Skip to content

Infer Return Type for select from useInfiniteQuery #2169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

awmichel
Copy link
Contributor

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

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

@awmichel awmichel requested a review from a team as a code owner February 24, 2025 23:25
@awmichel awmichel requested a review from htunnicliff February 24, 2025 23:25
Copy link

netlify bot commented Feb 24, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 3c70089

Copy link

changeset-bot bot commented Feb 24, 2025

🦋 Changeset detected

Latest commit: 3c70089

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

@htunnicliff htunnicliff removed their request for review February 24, 2025 23:40
@awmichel awmichel force-pushed the infer-select-return-from-infinite-query branch from 78225d2 to cab51d4 Compare May 1, 2025 23:13
@awmichel
Copy link
Contributor Author

awmichel commented May 1, 2025

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

Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, and tests look great too! No notes 🙂. Changeset looks good, so we can release after merge.

@drwpow drwpow merged commit a76801c into openapi-ts:main May 3, 2025
8 checks passed
@openapi-ts-bot openapi-ts-bot mentioned this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants