mirror of
https://github.com/vale981/Vulcan
synced 2025-03-04 17:21:37 -05:00
Temporarely fix apollo error bug.
This commit is contained in:
parent
b6da989deb
commit
e6d6049184
2 changed files with 12 additions and 4 deletions
|
@ -77,8 +77,8 @@ export const getErrors = error => {
|
|||
// if this is one or more GraphQL errors, extract and convert them
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
// get first graphQL error (see https://github.com/thebigredgeek/apollo-errors/issues/12)
|
||||
const graphQLError = error.graphQLErrors[0];
|
||||
const data = get(graphQLError, 'extensions.exception.data')
|
||||
const graphQLError = error.graphQLErrors[0].extensions.exception.errors[0];
|
||||
const data = get(graphQLError, 'extensions.data')
|
||||
if (data && !isEmpty(data)) {
|
||||
if (data.errors) {
|
||||
// 2. there are multiple errors on the data.errors object
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ApolloError } from 'apollo-server';
|
||||
import { GraphQLError } from 'graphql';
|
||||
|
||||
/*
|
||||
|
||||
|
@ -11,5 +11,13 @@ An error should have:
|
|||
*/
|
||||
export const throwError = error => {
|
||||
const { id, } = error;
|
||||
throw new ApolloError(id, 'VALIDATION_ERROR', error);
|
||||
throw new GraphQLError(
|
||||
id,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
error
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue