Add GraphQL error messages

This commit is contained in:
Ramon Wenger 2023-03-30 16:29:48 +02:00
parent d8b1f37d93
commit 353d430a3a
1 changed files with 6 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import { typeDefs } from '@/graphql/typedefs';
import { resolvers } from '@/graphql/resolvers';
import cache from './cache';
import log from 'loglevel';
import * as Sentry from '@sentry/vue';
import { router } from '@/router';
@ -45,9 +46,11 @@ export default function(uri, networkErrorCallback) {
}
if (graphQLErrors) {
graphQLErrors.forEach(({ message, locations, path }) =>
log.warn(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`)
);
graphQLErrors.forEach(({ message, locations, path }) => {
const err = `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`;
log.warn(err);
Sentry.captureMessage(err);
});
}
/*