t
t9mo ago

What is the mutation error type?

In the provider I want to set onError for all mutations:
new QueryClient({
defaultOptions: { mutations: { onError: (error: Error) => toast.error(error.message) } },
}),
new QueryClient({
defaultOptions: { mutations: { onError: (error: Error) => toast.error(error.message) } },
}),
But I don't know what type is needed for the error, my closest guess is in trpc.ts:
export type Error = TRPCClientError<typeof t.router>;
export type Error = TRPCClientError<typeof t.router>;
but it says that it's missing the following properties from type 'Procedure<"query" | "mutation" | "subscription", any>': _type, _def, _procedure
0 Replies
No replies yetBe the first to reply to this messageJoin