How to change the input type in trpc call
For context, i want to try to update the user's profile but i cant seem to add both the ctx argument and the input as a z.object (like in the example on their docs https://trpc.io/docs/v9/react-mutations ). I am not really sure what is wrong, any pointers would be appreciated.
useMutation() | tRPC
The hooks provided by @trpc/react are a thin wrapper around React Query. For in-depth information about options and usage patterns, refer to their docs on Mutations.
5 Replies
Argument of type '{ ctx: any; input: z.ZodObject' is not assignable to parameter of type '(opts: ResolveOptions<{ _config: RootConfig<{ ctx: { session: Session | null;
this is the error message
read the v10 docs
oh didn't notice i was reading the old docs
sorry !!
no worries lol
google searches still hit the v9 docs most of the time
Hey, just wanted to thank you. This fixed 90% of the problems i had with trpc