Skip to content

test({react,preact,solid,svelte}-query,angular-query-experimental): rename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests - #11448

Merged
sukvvon merged 1 commit into
mainfrom
test/mutation-context-vars-naming
Sep 8, 2026
Merged

test({react,preact,solid,svelte}-query,angular-query-experimental): rename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests#11448
sukvvon merged 1 commit into
mainfrom
test/mutation-context-vars-naming

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 8, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Follow-up to #11440#11444, which added a should type context as the last argument for mutationFn and every hook-level callback type test to react-query, preact-query, solid-query, svelte-query, angular-query-experimental, and vue-query.

In each file's test, the mutationFn's first parameter was named _vars: string, while the sibling onMutate/onSuccess/onError/onSettled callbacks in the same test (and every other mutationFn in the file) use _variables. vue-query's copy was already fixed in #11444; this applies the same fix — renaming to _variables and dropping the now-redundant : string annotation (the type is still contextually inferred from useMutation/injectMutation/createMutation, as verified by each package's --typecheck run) — to the remaining 5 adapters.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 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
    • Updated mutation typing tests across Angular, Preact, React, Solid, and Svelte integrations to rely on inferred variable types.
    • Standardized mutation function parameter naming in context callback tests.
    • Existing behavior and type assertions remain unchanged.

@sukvvon sukvvon self-assigned this Sep 8, 2026
@nx-cloud

nx-cloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e5b5cde

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

☁️ Nx Cloud last updated this comment at 2026-09-08 12:20:26 UTC

…ename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests
@sukvvon
sukvvon force-pushed the test/mutation-context-vars-naming branch from e5b5cde to 43c9835 Compare September 8, 2026 12:11
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

2 package(s) bumped directly, 23 bumped as dependents.

🟨 Minor bumps

Package Version Reason
@tanstack/query-core 5.102.8 → 5.103.0 Changeset
@tanstack/svelte-query 6.1.48 → 6.2.0 Changeset
@tanstack/angular-query-experimental 5.102.8 → 5.103.0 Dependent
@tanstack/angular-query-persist-client 5.102.8 → 5.103.0 Dependent
@tanstack/eslint-plugin-query 5.102.8 → 5.103.0 Dependent
@tanstack/preact-query 5.102.8 → 5.103.0 Dependent
@tanstack/preact-query-devtools 5.102.8 → 5.103.0 Dependent
@tanstack/preact-query-persist-client 5.102.8 → 5.103.0 Dependent
@tanstack/query-async-storage-persister 5.102.8 → 5.103.0 Dependent
@tanstack/query-broadcast-client-experimental 5.102.8 → 5.103.0 Dependent
@tanstack/query-devtools 5.102.8 → 5.103.0 Dependent
@tanstack/query-persist-client-core 5.102.8 → 5.103.0 Dependent
@tanstack/query-sync-storage-persister 5.102.8 → 5.103.0 Dependent
@tanstack/react-query 5.102.8 → 5.103.0 Dependent
@tanstack/react-query-devtools 5.102.8 → 5.103.0 Dependent
@tanstack/react-query-next-experimental 5.102.8 → 5.103.0 Dependent
@tanstack/react-query-persist-client 5.102.8 → 5.103.0 Dependent
@tanstack/solid-query 5.102.8 → 5.103.0 Dependent
@tanstack/solid-query-devtools 5.102.8 → 5.103.0 Dependent
@tanstack/solid-query-persist-client 5.102.8 → 5.103.0 Dependent
@tanstack/svelte-query-devtools 6.1.48 → 6.2.0 Dependent
@tanstack/svelte-query-persist-client 6.1.48 → 6.2.0 Dependent
@tanstack/vue-query 5.102.8 → 5.103.0 Dependent
@tanstack/vue-query-devtools 6.1.48 → 6.2.0 Dependent

🟩 Patch bumps

Package Version Reason
@tanstack/lit-query 0.2.20 → 0.2.21 Dependent

@sukvvon sukvvon changed the title test(*): rename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests test({react,preact,solid,svelte}-query,angular-query-experimental): rename 'mutationFn' param to '_variables' in 'MutationFunctionContext' tests Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4b67ad98-4efa-4103-b48a-dbe6d5ce8808

📥 Commits

Reviewing files that changed from the base of the PR and between 813bf33 and 43c9835.

📒 Files selected for processing (5)
  • packages/angular-query-experimental/src/__tests__/inject-mutation.test-d.ts
  • packages/preact-query/src/__tests__/useMutation.test-d.tsx
  • packages/react-query/src/__tests__/useMutation.test-d.tsx
  • packages/solid-query/src/__tests__/useMutation.test-d.tsx
  • packages/svelte-query/tests/createMutation/createMutation.test-d.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates mutation context typing tests across Angular, Preact, React, Solid, and Svelte. The callback parameter is renamed to _variables; four tests remove its explicit string annotation.

Changes

Mutation context typing tests

Layer / File(s) Summary
Update mutation variables parameters
packages/angular-query-experimental/src/__tests__/inject-mutation.test-d.ts, packages/preact-query/src/__tests__/useMutation.test-d.tsx, packages/react-query/src/__tests__/useMutation.test-d.tsx, packages/solid-query/src/__tests__/useMutation.test-d.tsx, packages/svelte-query/tests/createMutation/createMutation.test-d.ts
The mutation callback parameter is renamed from _vars to _variables. The Angular, Preact, Solid, and Svelte tests remove the explicit string annotation. The React test changes only the parameter name.

Priority: ⬇️ Low — Defer this test-only parameter rename because it makes no published-code or behavioral change across the query packages.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 43c98

This updates mutation callback type tests to infer the variables parameter across five framework packages, without changing published runtime behavior or APIs. No current merge-readiness risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the affected query adapters, the mutationFn parameter rename, and the relevant MutationFunctionContext tests.
Description check ✅ Passed The description follows the required template, explains the change and motivation, documents testing and checklist completion, and correctly identifies the change as dev-only with no release impact.
✨ 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/mutation-context-vars-naming

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11448

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 43c9835

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.85 KB (0%)
react minimal 8.84 KB (0%)

@sukvvon
sukvvon merged commit 50680b9 into main Sep 8, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/mutation-context-vars-naming branch September 8, 2026 12:22
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.

1 participant