Skip to content

fix(vue-query/useMutation): add missing '_defaulted' omit in 'UseMutationOptionsBase'#10215

Open
sukvvon wants to merge 2 commits intoTanStack:mainfrom
sukvvon:fix/vue-query-useMutation-omit-defaulted
Open

fix(vue-query/useMutation): add missing '_defaulted' omit in 'UseMutationOptionsBase'#10215
sukvvon wants to merge 2 commits intoTanStack:mainfrom
sukvvon:fix/vue-query-useMutation-omit-defaulted

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Mar 2, 2026

🎯 Changes

Add missing _defaulted omit in UseMutationOptionsBase type to align with other packages (react-query, svelte-query, solid-query, angular-query) that already omit _defaulted from MutationObserverOptions.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes

    • Refined useMutation public options to remove internal-only properties, improving type safety and preventing accidental reliance on implementation details.
  • Documentation

    • Added a patch release note documenting the fix.

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

🦋 Changeset detected

Latest commit: 70c6b33

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

This PR includes changesets to release 2 packages
Name Type
@tanstack/vue-query Patch
@tanstack/vue-query-devtools 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

This change omits the internal _defaulted property from the public UseMutationOptionsBase type in vue-query by applying OmitKeyof to MutationObserverOptions, adds the necessary import, and includes a changelog changeset documenting the patch.

Changes

Cohort / File(s) Summary
Changeset Entry
.changeset/fuzzy-chicken-listen.md
Adds a new changeset documenting a patch release that notes the _defaulted omit fix for UseMutationOptionsBase.
Vue Query Type Fix
packages/vue-query/src/useMutation.ts
Type update: UseMutationOptionsBase now uses OmitKeyof<MutationObserverOptions<...>,'_defaulted'> & ShallowOption; adds OmitKeyof import from @tanstack/query-core.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • lachlancollins
  • TkDodo

Poem

🐰 I nibbled at types with careful cheer,
_defaulted hidden, no longer near,
A gentle omit, a tidy delight,
The API gleams in soft moonlight. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a missing '_defaulted' omit to the UseMutationOptionsBase type in vue-query/useMutation, which aligns with the code modifications shown in the summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description fully follows the template with all required sections completed, including clear changes explanation, checklist items marked, and release impact documented.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@nx-cloud
Copy link

nx-cloud bot commented Mar 2, 2026

View your CI Pipeline Execution ↗ for commit 1fa850d

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 25s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-02 18:45:03 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 2, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10215

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10215

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10215

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10215

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10215

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10215

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10215

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10215

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10215

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10215

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10215

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10215

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10215

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10215

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10215

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10215

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10215

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10215

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10215

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10215

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10215

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10215

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10215

commit: c843443

@sukvvon sukvvon marked this pull request as ready for review March 2, 2026 18:31
@sukvvon sukvvon force-pushed the fix/vue-query-useMutation-omit-defaulted branch from 89613e4 to 70c6b33 Compare March 2, 2026 18:40
@sukvvon sukvvon force-pushed the fix/vue-query-useMutation-omit-defaulted branch from 70c6b33 to 1fa850d Compare March 2, 2026 18:43
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.

1 participant