Skip to content

feat: add mutationOptions helper#84

Merged
js2me merged 1 commit into
js2me:masterfrom
y0na24:master
May 19, 2026
Merged

feat: add mutationOptions helper#84
js2me merged 1 commit into
js2me:masterfrom
y0na24:master

Conversation

@y0na24
Copy link
Copy Markdown
Contributor

@y0na24 y0na24 commented May 19, 2026

Add mutationOptions https://tanstack.com/query/latest/docs/framework/react/reference/mutationOptions


Summary by cubic

Adds mutationOptions helper for strongly typed mutation configs. Improves type inference with no runtime changes and is exported from the package entry.

  • New Features
    • Added mutationOptions(options) helper that returns the given options while inferring types from MutationConfig (excluding queryClient).
    • Re-exported from src/index.ts for top-level import.

Written for commit 3a8bcea. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features
    • Added mutationOptions helper function with full TypeScript type support for streamlined mutation configuration management in TanStack Query integration.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 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: e01cb188-6c7c-4c65-b987-af56f07739ec

📥 Commits

Reviewing files that changed from the base of the PR and between 924d659 and 3a8bcea.

📒 Files selected for processing (3)
  • .changeset/rich-llamas-run.md
  • src/index.ts
  • src/mutation-options.ts

📝 Walkthrough

Walkthrough

This PR adds a new mutationOptions helper function that provides a typed wrapper around mutation configuration. The helper reuses MutationConfig generics while excluding the queryClient field. It is exported publicly via the package's main entry point and documented as a minor version bump.

Changes

MutationOptions Helper

Layer / File(s) Summary
mutationOptions helper implementation
src/mutation-options.ts
MutationOptionsParams interface extends MutationConfig while omitting queryClient, and the exported mutationOptions function uses TypeScript overloads to preserve generic types at compile time while returning the input unchanged at runtime.
Public API exposure and release notes
src/index.ts, .changeset/rich-llamas-run.md
The new helper is re-exported from the main entry point, and a Changesets entry documents the release as a minor version bump with the note "add mutationOptions helper".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A tiny helper hops into the light,
Wrapping mutations with types so tight,
No queryClient cluttering the way,
Generic magic saves the day!
Published proudly, minor and bright. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat: add mutationOptions helper' directly and clearly describes the main change—adding a new mutationOptions helper function—which is confirmed by all three modified files in the changeset.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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 and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@js2me js2me merged commit 987d471 into js2me:master May 19, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request May 19, 2026
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.

2 participants