Skip to content
This repository has been archived by the owner on Mar 7, 2022. It is now read-only.

Commit

Permalink
Partial changes from [PR ardatan#1074](ardatan#1074)
Browse files Browse the repository at this point in the history
Preserve source error extensions when merging schemas

- Fix bug
  • Loading branch information
alexneamtu committed Apr 12, 2019
1 parent 58065f0 commit 46dd092
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/stitching/defaultMergedResolver.ts
@@ -1,4 +1,4 @@
import { GraphQLFieldResolver, responsePathAsArray } from 'graphql';
import { GraphQLError, GraphQLFieldResolver, responsePathAsArray } from 'graphql';
import { locatedError } from 'graphql/error';
import { getErrorsFromParent, annotateWithChildrenErrors } from './errors';
import { getResponseKeyFromInfo } from './getResponseKeyFromInfo';
Expand All @@ -16,7 +16,16 @@ const defaultMergedResolver: GraphQLFieldResolver<any, any> = (parent, args, con

if (errorResult.kind === 'OWN') {
throw locatedError(
errorResult.error.originalError || new Error(errorResult.error.message),
errorResult.error.originalError ||
new GraphQLError(
errorResult.error.message,
null,
null,
null,
null,
null,
errorResult.error.extensions,
),
info.fieldNodes,
responsePathAsArray(info.path),
);
Expand Down

0 comments on commit 46dd092

Please sign in to comment.