Don't show 401 graphQL errors
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
4e1d49693f
commit
dbd1e6fe2c
@ -26,6 +26,7 @@ import {
|
|||||||
typePolicies,
|
typePolicies,
|
||||||
refreshAccessToken,
|
refreshAccessToken,
|
||||||
} from "./apollo/utils";
|
} from "./apollo/utils";
|
||||||
|
import { GraphQLError } from "graphql";
|
||||||
|
|
||||||
// Install the vue plugin
|
// Install the vue plugin
|
||||||
Vue.use(VueApollo);
|
Vue.use(VueApollo);
|
||||||
@ -120,10 +121,14 @@ const errorLink = onError(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (graphQLErrors) {
|
if (graphQLErrors) {
|
||||||
graphQLErrors.map(({ message, locations, path }) =>
|
graphQLErrors.map(
|
||||||
console.log(
|
(graphQLError: GraphQLError & { status_code?: number }) => {
|
||||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
if (graphQLError?.status_code !== 401) {
|
||||||
)
|
console.log(
|
||||||
|
`[GraphQL error]: Message: ${graphQLError.message}, Location: ${graphQLError.locations}, Path: ${graphQLError.path}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user