Calling a mutation from a mutation
@Manomite asked:
Please does anyone knows how to reuse internal query in mutations... Or how can I reuse internalQuery or internalMutations in another export?
4 Replies
Okay thanks... Am here
Can you share the mutation? I can walk you through it. Otherwise I can throw up some pseudo code.
If you need to reuse a piece of logic between multiple mutations write a normal JS function that takes
MutationCtx
and call it from your mutations.
See https://docs.convex.dev/typescript#type-annotating-server-side-helpersTypeScript | Convex Developer Hub
Move faster with end-to-end type safety.
Ooohh... Am off the computer now... Probably tomorrow morning will paste the code...
But a pseudo code could help too..
I will try this approach and see if it works then revert back... Thanks...
Got this solved... Thanks...