Skip to content

Conversation

@lipecki
Copy link
Contributor

@lipecki lipecki commented Oct 9, 2025

Fix react-query mutation typing for v5.90

Summary

  • Update the React Query generator to support the current UseMutationOptions signature from @tanstack/react-query (the fourth generic now represents onMutate results; mutation callbacks receive an extra context argument).
  • Simplify the generated useRapiniMutation helper so it forwards callback arguments transparently, removing hard-coded parameter lists and keeping future TanStack changes from breaking the wrapper.
  • Adjust the mutation generator and specs to emit the new helper call-site signature and assert the expected TypeScript output.

These changes are necessary for react-query versions v5.89.0 and newer, as mentioned in TanStack/query/ issue 9660:
v5.89.0: onError, onSuccess and onSettled signature change breaks existing code and were created with the help of an AI agent.

Testing

  • npm test
  • npm run build
  • I have added or updated unit tests for this change.
  • I have updated the changelog with info about the changes in this PR

Copy link
Owner

@rametta rametta left a comment

Choose a reason for hiding this comment

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

This is great, thanks for the PR!

@rametta rametta merged commit f6a4c24 into rametta:main Oct 14, 2025
3 checks passed
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