-
This is my provider's client: const globalHandler = {
onError: () => console.log('on error from global handler'),
};
const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry(failureCount, error) {
/* .. */
},
},
},
queryCache: new QueryCache(globalHandler),
mutationCache: new MutationCache(globalHandler),
}); It works as expects with queries but not with mutations. Here's my mutation: const { mutateAsync } = useMutation({
mutationKey: ['key'],
mutationFn: () => {
throw new Error('Not implemented');
},
throwOnError: true,
onError: (error: Error) => {
console.log('on error from local handler');
},
}); I tried with and without What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Feb 12, 2025
Replies: 1 comment 1 reply
-
should work the same. show a minimal reproduction please |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Falci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should work the same. show a minimal reproduction please