t
t
TtRPC
Created by t on 11/12/2023 in #❓-help
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
2 replies