fix(openapi-react-query): mutation results type
Changes
Adds proper types to the useMutation's onMutateResults fields which are used in onSettled, onError & return object of this hook.
The open issue regarding this bug: https://github.com/openapi-ts/openapi-typescript/issues/2518
I ended up digging further & this seems to fix it, but looking forward for a second pair of eyes to check that my fix is correct 🙂
Here I moved the Options type definition from the generic parameters to the actual options parameter themselves, thus not setting the UseMutationOptions's TOnMutateResult to the default unknown.
How to Review
Checklist
- [x] Unit tests updated
- [ ]
docs/updated (if necessary) - [ ]
pnpm run update:examplesrun (only applicable for openapi-typescript)
Deploy request for openapi-ts pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | ded751e078e3f1a71c4908cdc055f384ebd7ea62 |
⚠️ No Changeset found
Latest commit: ded751e078e3f1a71c4908cdc055f384ebd7ea62
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
Tests fail due to a refactor in Redocly's test folder structure (unrelated to this PR's change), I've opened a separate PR to address that here https://github.com/openapi-ts/openapi-typescript/pull/2522