@graphql-tools/delegate 7.0.3 → 7.0.5

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.
package/es5/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { cloneSchema, serializeInputValue, updateArgument, collectFields, relocatedError, mergeDeep, getResponseKeyFromInfo, implementsAbstractType, mapAsyncIterator } from '@graphql-tools/utils/es5';
2
2
  import { __assign, __spread, __values, __read } from 'tslib';
3
3
  import { Kind, typeFromAST, GraphQLError, responsePathAsArray, getNamedType, getNullableType, isLeafType, isCompositeType, isListType, isAbstractType, locatedError, defaultFieldResolver, TypeInfo, visit, visitWithTypeInfo, print, isInterfaceType, isObjectType, TypeNameMetaFieldDef, getOperationAST, subscribe, validate, execute } from 'graphql';
4
+ import AggregateError from '@ardatan/aggregate-error';
4
5
  import isPromise from 'is-promise';
5
- import AggregateError$1 from '@ardatan/aggregate-error';
6
6
  import { getBatchingExecutor } from '@graphql-tools/batch-execute/es5';
7
7
 
8
8
  function applySchemaTransforms(originalWrappingSchema, subschemaConfig, transformedSchema) {
@@ -564,7 +564,8 @@ function mergeFields(mergedTypeInfo, typeName, object, fieldNodes, sourceSubsche
564
564
  var containsPromises = false;
565
565
  var resultMap = new Map();
566
566
  delegationMap.forEach(function (selectionSet, s) {
567
- var maybePromise = s.merge[typeName].resolve(object, context, info, s, selectionSet);
567
+ var resolver = mergedTypeInfo.resolvers.get(s);
568
+ var maybePromise = resolver(object, context, info, s, selectionSet);
568
569
  resultMap.set(maybePromise, selectionSet);
569
570
  if (isPromise(maybePromise)) {
570
571
  containsPromises = true;
@@ -1411,7 +1412,7 @@ function mergeDataAndErrors(data, errors, path, index) {
1411
1412
  var newPath = path === undefined ? error.path : error.path === undefined ? path : path.concat(error.path.slice(1));
1412
1413
  return { data: relocatedError(errors[0], newPath), unpathedErrors: [] };
1413
1414
  }
1414
- return { data: locatedError(new AggregateError$1(errors), undefined, path), unpathedErrors: [] };
1415
+ return { data: locatedError(new AggregateError(errors), undefined, path), unpathedErrors: [] };
1415
1416
  }
1416
1417
  if (!errors.length) {
1417
1418
  return { data: data, unpathedErrors: [] };
@@ -1707,7 +1708,7 @@ function validateRequest(targetSchema, document) {
1707
1708
  var errors = validate(targetSchema, document);
1708
1709
  if (errors.length > 0) {
1709
1710
  if (errors.length > 1) {
1710
- var combinedError = new AggregateError$1(errors);
1711
+ var combinedError = new AggregateError(errors);
1711
1712
  throw combinedError;
1712
1713
  }
1713
1714
  var error = errors[0];