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


4 Replies
passive-yellowOP•2y ago
optimistic-gold•2y ago
You can use satisfies
sensitive-blue•15mo ago
@TkDodo 🔮 do you know if there is a way to bundle the
satisfies MutationOptions<any, any, any, any> approach into a util?rival-black•15mo ago