Skip to content

fix(openapi-react-query): reject query options as request init - #2857

Open
lprnmns wants to merge 1 commit into
openapi-ts:mainfrom
lprnmns:fix/reject-query-options-as-init
Open

fix(openapi-react-query): reject query options as request init#2857
lprnmns wants to merge 1 commit into
openapi-ts:mainfrom
lprnmns:fix/reject-query-options-as-init

Conversation

@lprnmns

@lprnmns lprnmns commented Aug 31, 2026

Copy link
Copy Markdown

Changes

Fixes #2642.

The third useQuery argument is the fetch init object and the fourth argument is the React Query options object. Before this change, the fetch init type accepted React Query keys such as retry, so those options could be silently ignored at runtime. The public init types now reserve React Query option keys while retaining arbitrary request-init extensions.

How to Review

Review QueryInit and InfiniteQueryInit in packages/openapi-react-query/src/index.ts. The regression test rejects retry in the third argument and keeps a custom request-init extension accepted. The Changeset declares a patch release for openapi-react-query.

Validation

  • pnpm run build - passed before the change
  • pnpm --filter openapi-react-query test - passed before the change; 37 tests
  • ../../node_modules/.bin/tsc --noEmit -p tsconfig.json - passed after the change
  • ../../node_modules/.bin/biome check . --diagnostic-level=error - passed after the change
  • ../../node_modules/.bin/vitest run test/index.test.tsx - passed after the change; 38 tests
  • git diff HEAD^ HEAD --check - passed

The pnpm wrapper could not be rerun after the change because the environment filesystem was full (ENOSPC); the direct local TypeScript, Biome, and Vitest checks passed.

Checklist

  • Unit tests updated
  • docs/ updated (not necessary)
  • pnpm run update:examples run (not applicable for openapi-react-query)

@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5e2195f

@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5e2195f

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

@lprnmns
lprnmns marked this pull request as ready for review August 31, 2026 15:04
@lprnmns
lprnmns requested a review from a team as a code owner August 31, 2026 15:04
@lprnmns
lprnmns requested a review from drwpow August 31, 2026 15:04
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.

useQuery silently accepts queryOptions in the options parameter without type error

1 participant