We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04bcaff commit 8e55d02Copy full SHA for 8e55d02
src/apolo/index.js
@@ -10,7 +10,7 @@ const filter_out_error_set = {
10
};
11
12
export const globalErrorHandler = ({ networkError = {}, graphQLErrors = [] }) => {
13
- if (networkError.statusCode === 500) {
+ if (networkError && networkError.statusCode === 500) {
14
window.logger.err("Internal server error");
15
}
16
src/hooks/index.js
@@ -16,14 +16,4 @@ export function useTranslations() {
return result;
17
18
19
-export function useMutation(mutation, { onError, ...options } = {}) {
20
- return useApolloMutation(mutation, {
21
- onError: onError
22
- ? error => {
23
- globalErrorHandler(error);
24
- onError(error);
25
- }
26
- : globalErrorHandler,
27
- ...options
28
- });
29
-}
+export const useMutation = useApolloMutation;
0 commit comments