Skip to content

Fix undefined initial page param in useInfiniteQuery#2826

Open
qybaihe wants to merge 1 commit into
openapi-ts:mainfrom
qybaihe:fix-2715-undefined-page-param
Open

Fix undefined initial page param in useInfiniteQuery#2826
qybaihe wants to merge 1 commit into
openapi-ts:mainfrom
qybaihe:fix-2715-undefined-page-param

Conversation

@qybaihe
Copy link
Copy Markdown

@qybaihe qybaihe commented Jun 1, 2026

Changes

Fixes #2715

  • omit the configured page query parameter when TanStack supplies an undefined initial page param
  • keep explicit page params, including 0, in requests
  • add a regression test for undefined initialPageParam followed by fetchNextPage()
  • add a patch changeset for openapi-react-query

How to Review

Check packages/openapi-react-query/src/index.ts and the new useInfiniteQuery regression test. The first request should keep existing query params like limit while omitting cursor; the second request should include the next cursor.

Checklist

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

Validation:

  • pnpm run build
  • pnpm --filter openapi-react-query exec vitest run test/index.test.tsx -t "should omit cursor"
  • pnpm --filter openapi-react-query test
  • pnpm --filter openapi-react-query lint

@qybaihe qybaihe requested a review from a team as a code owner June 1, 2026 03:47
@qybaihe qybaihe requested a review from drwpow June 1, 2026 03:47
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 1, 2026

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit da05da5

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 1, 2026

🦋 Changeset detected

Latest commit: da05da5

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 Patch

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

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.

useInfiniteQuery sends page param with value 0 on first page when initialPageParam is undefined

1 participant