I found examples on how to type query results:
interface RootContextData{
clientId:string;
weightQuery:UseTRPCQueryResult<inferRouterOutputs<AppRouter>['children']['getWeight'], TRPCClientErrorLike<AppRouter>>,
clientQuery:UseTRPCQueryResult<inferRouterOutputs<AppRouter>['clients']['getClient'], TRPCClientErrorLike<AppRouter>>,
}
But how to achieve the same for Mutations?
I figured it could be something like this:
{
childrenAddWeightMutation:UseTRPCMutationResult<inferRouterOutputs<AppRouter>['children']['addWeight'], TRPCClientErrorLike<AppRouter>>
}
It asks for two more variables TVariables, TContext, not sure how to go about them.