const mutationCache = new MutationCache({
onError: (error, _variables, _context, mutation) => {
withScope((scope) => {
// ignore issue if issue will be handled by local error handler
//if (mutation.options.onError) return;
// group issues for sentry report
const fingerprint = mutation.options.mutationKey;
scope.setContext('mutation', {
mutationId: mutation.mutationId,
variables: mutation.state.variables,
});
if (mutation.options.mutationKey) {
scope.setFingerprint(Array.from(mutation.options.mutationKey) as string[]);
}
// sentry error logging
captureException(error);
});
},
});
const mutationCache = new MutationCache({
onError: (error, _variables, _context, mutation) => {
withScope((scope) => {
// ignore issue if issue will be handled by local error handler
//if (mutation.options.onError) return;
// group issues for sentry report
const fingerprint = mutation.options.mutationKey;
scope.setContext('mutation', {
mutationId: mutation.mutationId,
variables: mutation.state.variables,
});
if (mutation.options.mutationKey) {
scope.setFingerprint(Array.from(mutation.options.mutationKey) as string[]);
}
// sentry error logging
captureException(error);
});
},
});