TanStackT
TanStack2y ago
4 replies
foolish-indigo

mutationOptions helper

Hi there! I've been working on refactoring some of my codebase's react-query usage (with inspiration from https://tkdodo.eu/blog/the-query-options-api).

I see there is a queryOptions helper, which can be used to build QueryOptions objects, and I've gotten through refactoring all of my queries. Is there such a thing for useMutation?

Even though my function is returning a type that satisfies UseMutationOptions, typescript seems to not like it. Any suggestions? Thanks
CleanShot_2024-01-25_at_17.10.14.png
CleanShot_2024-01-25_at_17.10.57.png
Was this page helpful?