Skip to content

feat(solid-query): add 'mutationOptions'#10138

Open
sukvvon wants to merge 2 commits intoTanStack:mainfrom
sukvvon:feat/solid-query-mutationOptions
Open

feat(solid-query): add 'mutationOptions'#10138
sukvvon wants to merge 2 commits intoTanStack:mainfrom
sukvvon:feat/solid-query-mutationOptions

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Feb 16, 2026

🎯 Changes

Add mutationOptions identity function to @tanstack/solid-query, matching the existing react-query and preact-query implementations.

  • packages/solid-query/src/mutationOptions.ts — identity function with 2 overloads (with/without mutationKey)
  • packages/solid-query/src/index.ts — export mutationOptions
  • packages/solid-query/src/__tests__/mutationOptions.test.tsx — 14 runtime tests
  • packages/solid-query/src/__tests__/mutationOptions.test-d.tsx — 13 type tests
  • docs/framework/solid/reference/mutationOptions.md — docs (ref to react docs)

✅ 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

  • New Features

    • Introduced mutationOptions utility to improve type safety for mutation configurations, including handling of mutation keys and callback option typings.
  • Documentation

    • Added reference documentation for mutationOptions.
  • Tests

    • Added extensive type-safety and integration tests covering mutation behavior, key filtering, and hook interactions.

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 879b859

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

This PR includes changesets to release 3 packages
Name Type
@tanstack/solid-query Minor
@tanstack/solid-query-devtools Major
@tanstack/solid-query-persist-client Major

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

@github-actions github-actions bot added documentation Improvements or additions to documentation package: solid-query labels Feb 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 879b859 and 8490b9e.

📒 Files selected for processing (1)
  • packages/solid-query/src/__tests__/mutationOptions.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/solid-query/src/tests/mutationOptions.test.tsx

📝 Walkthrough

Walkthrough

Adds a new exported mutationOptions utility to Solid Query (type-level overloads for required/optional mutationKey), plus tests, docs, and a changeset documenting a minor version bump.

Changes

Cohort / File(s) Summary
Changeset & Docs
\.changeset/quick-taxes-cover.md, docs/framework/solid/reference/mutationOptions.md
Adds changeset entry for minor version bump and new feature; adds reference documentation page with YAML front matter.
Public API Export
packages/solid-query/src/index.ts
Re-exports mutationOptions from the package index.
Core Implementation
packages/solid-query/src/mutationOptions.ts
Introduces mutationOptions with three TypeScript overloads (WithRequired mutationKey, Omit mutationKey, and full options); implementation returns the input unchanged as a type-level helper.
Type Tests
packages/solid-query/src/__tests__/mutationOptions.test-d.tsx
Adds extensive TS type-safety tests covering excess property rejection, inference for callbacks/variables/data/context, integration points (useMutation, useIsMutating, queryClient.isMutating, useMutationState), and utility-type behaviors.
Runtime Tests
packages/solid-query/src/__tests__/mutationOptions.test.tsx
Adds runtime tests validating pass-through behavior and interactions with useIsMutating, useMutationState, and queryClient.isMutating, including keyed/unkeyed and concurrent mutation scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • TkDodo

Poem

🐰 A mutation helper hops into view,
Types aligned for key or free,
Tests that probe both thought and run,
Docs to tell the tale to thee,
Solid Query hops on, bright and new!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(solid-query): add mutationOptions' clearly and concisely describes the main change: adding a new mutationOptions feature to solid-query, matching the format of similar framework additions.
Description check ✅ Passed The pull request description comprehensively covers all required template sections: detailed change summary, completed checklist items, and release impact confirmation with changeset generated.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 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 Feb 16, 2026

View your CI Pipeline Execution ↗ for commit 879b859

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

☁️ Nx Cloud last updated this comment at 2026-02-24 01:11:01 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 16, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 879b859

@sukvvon sukvvon force-pushed the feat/solid-query-mutationOptions branch from 8490b9e to 879b859 Compare February 24, 2026 01:08
@TkDodo TkDodo requested a review from birkskyum February 25, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package: solid-query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant