Await tRPC Mutation response
Can you await a trpc mutation response?
For instance onClick fire a async function handler and await the trpc.user.create.mutation()
3 Replies
from the react-query docs
https://tanstack.com/query/v4/docs/react/guides/mutations
Mutations | TanStack Query Docs
Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. For this purpose, TanStack Query exports a useMutation hook.
Here's an example of a mutation that adds a new todo to the server:
ah dang wasn't done typing haha
@MrNiceRicee Perfect thanks mate!