Skip to content

test(vue-query/mutationOptions): add reactive 'mutationKey' test for getter overload#10474

Merged
sukvvon merged 1 commit intomainfrom
test/vue-query-mutationOptions-getter-reactive-mutationKey
Apr 13, 2026
Merged

test(vue-query/mutationOptions): add reactive 'mutationKey' test for getter overload#10474
sukvvon merged 1 commit intomainfrom
test/vue-query-mutationOptions-getter-reactive-mutationKey

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 13, 2026

🎯 Changes

  • Add reactive mutationKey test for mutationOptions getter overload:
    • should reactively update mutationKey when ref changes in getter: verifies that when a ref used inside mutationOptions(() => ({ mutationKey: [...key, keyRef.value] })) changes, the mutation picks up the updated key

✅ 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

  • Tests
    • Enhanced test coverage for reactive mutation key behavior with Vue refs, ensuring proper updates across mutations.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 13, 2026

View your CI Pipeline Execution ↗ for commit 5efe212

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

☁️ Nx Cloud last updated this comment at 2026-04-13 03:29:38 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bde8d1eb-0735-46c4-ae07-3b48d055d3e6

📥 Commits

Reviewing files that changed from the base of the PR and between 4c489e4 and 5efe212.

📒 Files selected for processing (1)
  • packages/vue-query/src/__tests__/mutationOptions.test.ts

📝 Walkthrough

Walkthrough

Added a test case to mutationOptions.test.ts that verifies reactive behavior of mutationKey within a getter function. The test constructs mutationKey using a Vue ref, performs mutations, and confirms the mutationFn receives updated values when the ref changes.

Changes

Cohort / File(s) Summary
Test Enhancement
packages/vue-query/src/__tests__/mutationOptions.test.ts
Updated imports to include queryKey from @tanstack/query-test-utils. Added test case verifying reactive mutationKey updates within mutationOptions getter, confirming mutations work correctly with changing ref values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A key that shifts like morning dew,
Wrapped in Vue's reactive view,
The test hops forth, then hops back through—
Mutations dance with references new! 🌿✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a reactive 'mutationKey' test for the getter overload in vue-query/mutationOptions.
Description check ✅ Passed The description follows the repository template structure, includes the required 🎯 Changes section with clear details, a completed ✅ Checklist with all items verified, and properly marked 🚀 Release Impact indicating dev-only changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/vue-query-mutationOptions-getter-reactive-mutationKey

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

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 5efe212

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon self-assigned this Apr 13, 2026
@sukvvon sukvvon merged commit c9109b6 into main Apr 13, 2026
10 checks passed
@sukvvon sukvvon deleted the test/vue-query-mutationOptions-getter-reactive-mutationKey branch April 13, 2026 04:22
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