taylor.prestoT
tRPC4y ago
3 replies
taylor.presto

How to infer the output of a mutation? The current methods appear to be depreciated.

I am attempting to export the bellow utility function to use client side to infer an output type that I can pass to a couple components that are consuming the data.

It appears the the ''mutations' is depreciated here when trying to access it off the '_dep'? I did some digging the code base and that seems to be the case.

Does anyone have advice on how to infer this type so I can pass it where it is needed?

export type inferMutationOutput<
  TRouteKey extends keyof AppRouter['_def']['mutations']
> = inferProcedureOutput<AppRouter['_def']['mutations'][TRouteKey]>
Screen_Shot_2022-10-21_at_11.26.31_AM.png
Was this page helpful?