Skip to content

Conversation

minchodang
Copy link

Changes

  • Added the $api.mutationOptions helper to openapi-react-query, mirroring the existing query helpers so consumers can generate fully typed React Query mutation configs without rewriting fetchers.
  • Extended the test and type surface to cover the new helper, ensuring mutation keys and inferred data/error types line up with the underlying OpenAPI schema.
  • Documented the helper in docs/openapi-react-query/mutation-options.md with a worked example, API breakdown, and guidance on when to prefer it over $api.useMutation.
  • Closes #2485.

How to Review

  • Review packages/openapi-react-query/src/index.ts to confirm mutationOptions shares the same contract as $api.useMutation, especially around the inferred types and key generation.
  • Check the accompanying tests under packages/openapi-react-query/test/ to verify they cover both the happy path and type expectations for the new helper.
  • Open the new doc page (pnpm docs:dev/openapi-react-query/mutation-options) to ensure the example builds, links resolve, and the narrative aligns with the query-side documentation.
  • Validate there are no regressions for existing helpers by running pnpm check (or the repo’s CI equivalent) before merging.

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

@minchodang minchodang requested a review from a team as a code owner October 6, 2025 08:31
Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: ec187d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Oct 6, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ec187d0

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.

Add mutationOptions (parity with TanStack Query)
1 participant