Skip to content

feat(react-query): backport mutationOptions#10368

Merged
manudeli merged 1 commit intov4from
react-query/feat/mutationOptions-backport
Apr 1, 2026
Merged

feat(react-query): backport mutationOptions#10368
manudeli merged 1 commit intov4from
react-query/feat/mutationOptions-backport

Conversation

@manudeli
Copy link
Copy Markdown
Collaborator

@manudeli manudeli commented Apr 1, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2c348e26-69e5-4825-84b9-3239cd935ace

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch react-query/feat/mutationOptions-backport

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 1, 2026

View your CI Pipeline Execution ↗ for commit 2b0fe33

Command Status Duration Result
nx affected --targets=test:lib,test:types,test:... ✅ Succeeded 1m 4s View ↗
nx affected --targets=test:lib --base=430bdd067... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-01 03:58:33 UTC

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR backports a mutationOptions helper into @tanstack/react-query, aligning it with existing “options helper” utilities (like queryOptions) and adding both runtime and type-level tests to validate inference and usage.

Changes:

  • Added mutationOptions helper with overloads to preserve strong typing (with and without mutationKey).
  • Exported mutationOptions from the react-query public entrypoint.
  • Added runtime and type-level test coverage for the new helper, plus updated the lockfile for codemod-related dependencies.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Updates lockfile (notably adds new importer entries and jscodeshift-related dependencies).
packages/react-query/src/mutationOptions.ts Introduces the mutationOptions helper with TS overloads.
packages/react-query/src/index.ts Re-exports mutationOptions from the package entrypoint.
packages/react-query/src/tests/mutationOptions.types.test.tsx Adds type-level assertions for inference/overload behavior.
packages/react-query/src/tests/mutationOptions.test.tsx Adds runtime tests validating identity behavior and integration with hooks/filters.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pnpm-lock.yaml Outdated
Comment thread pnpm-lock.yaml Outdated
Comment thread packages/react-query/src/mutationOptions.ts Outdated
@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Apr 1, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2b0fe33:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@manudeli manudeli marked this pull request as ready for review April 1, 2026 03:53
@manudeli manudeli force-pushed the react-query/feat/mutationOptions-backport branch from 326e148 to 2b0fe33 Compare April 1, 2026 03:56
@manudeli manudeli merged commit 006ce1a into v4 Apr 1, 2026
7 checks passed
@manudeli manudeli deleted the react-query/feat/mutationOptions-backport branch April 1, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants