tRPCttRPC
Powered by
IndigoI
tRPC•2y ago•
2 replies
Indigo

How can you extract the mutation type signature?

Hi folks, this isn't a major issue and not blocking by any stretch.

I was hoping to abstract my mutation callback so that I can keep my router relatively flat.

export const getUserAuthRouter = () =>
  router({
    googleAuthRedirect: publicProcedure
      .input(z.object({ credential: z.string() }))
      .mutation(googleAuthRedirectMutation),
  });
export const getUserAuthRouter = () =>
  router({
    googleAuthRedirect: publicProcedure
      .input(z.object({ credential: z.string() }))
      .mutation(googleAuthRedirectMutation),
  });


If I wanted to do something like this, is there a way to pull out the type signature for my callback?

I tried importing a few things but they were all in a module explicitly labelled not to import from 😅

Thanks!
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to extract mutation type
MugetsuMMugetsu / ❓-help
2y ago
Mutation type issue
OutisOOutis / ❓-help
4y ago
What is the mutation error type?
Answer OverflowAAnswer Overflow / ❓-help
3y ago