@graphql-tools/executor 1.1.0-alpha-20230523100348-6c3466d9 → 1.1.0-alpha-20230523100937-3794de50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -566,8 +566,8 @@ function completeLeafValue(returnType, result) {
566
566
  serializedResult = returnType.serialize(result);
567
567
  }
568
568
  catch (err) {
569
- if (err && typeof err['message'] === 'string') {
570
- throw new Error(err['message']);
569
+ if (err instanceof graphql_1.GraphQLError) {
570
+ throw new Error(err.message);
571
571
  }
572
572
  throw err;
573
573
  }
@@ -1,4 +1,4 @@
1
- import { locatedError, Kind, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, assertValidSchema, getDirectiveValues, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from 'graphql';
1
+ import { locatedError, Kind, isAbstractType, isLeafType, isListType, isNonNullType, isObjectType, assertValidSchema, getDirectiveValues, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, GraphQLError, } from 'graphql';
2
2
  import { createGraphQLError, inspect, isAsyncIterable, isIterableObject, isObjectLike, isPromise, pathToArray, addPath, getArgumentValues, promiseReduce, memoize3, getDefinedRootType, mapAsyncIterator, GraphQLStreamDirective, collectFields, collectSubFields as _collectSubfields, memoize1, } from '@graphql-tools/utils';
3
3
  import { getVariableValues } from './values.js';
4
4
  import { promiseForObject } from './promiseForObject.js';
@@ -558,8 +558,8 @@ function completeLeafValue(returnType, result) {
558
558
  serializedResult = returnType.serialize(result);
559
559
  }
560
560
  catch (err) {
561
- if (err && typeof err['message'] === 'string') {
562
- throw new Error(err['message']);
561
+ if (err instanceof GraphQLError) {
562
+ throw new Error(err.message);
563
563
  }
564
564
  throw err;
565
565
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor",
3
- "version": "1.1.0-alpha-20230523100348-6c3466d9",
3
+ "version": "1.1.0-alpha-20230523100937-3794de50",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
@@ -1,5 +1,4 @@
1
- import { GraphQLFormattedError, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLTypeResolver, GraphQLSchema, DocumentNode } from 'graphql';
2
- import type { GraphQLError } from 'graphql';
1
+ import { GraphQLFormattedError, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLTypeResolver, GraphQLSchema, DocumentNode, GraphQLError } from 'graphql';
3
2
  import { Path, Maybe, MaybePromise } from '@graphql-tools/utils';
4
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
5
4
  export interface SingularExecutionResult<TData = any, TExtensions = any> {
@@ -1,5 +1,4 @@
1
- import { GraphQLFormattedError, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLTypeResolver, GraphQLSchema, DocumentNode } from 'graphql';
2
- import type { GraphQLError } from 'graphql';
1
+ import { GraphQLFormattedError, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, GraphQLField, GraphQLFieldResolver, GraphQLObjectType, GraphQLResolveInfo, GraphQLTypeResolver, GraphQLSchema, DocumentNode, GraphQLError } from 'graphql';
3
2
  import { Path, Maybe, MaybePromise } from '@graphql-tools/utils';
4
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
5
4
  export interface SingularExecutionResult<TData = any, TExtensions = any> {