IndigoI
tRPC2y 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),
  });


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!
Was this page helpful?