@graphql-tools/delegate 6.0.10-alpha-19feca2.0 → 6.0.10

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/index.cjs.js CHANGED
@@ -2,8 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
5
7
  const graphql = require('graphql');
6
8
  const utils = require('@graphql-tools/utils');
9
+ const AggregateError = _interopDefault(require('aggregate-error'));
7
10
 
8
11
  const OBJECT_SUBSCHEMA_SYMBOL = Symbol('initialSubschema');
9
12
  const FIELD_SUBSCHEMA_MAP_SYMBOL = Symbol('subschemaMap');
@@ -726,7 +729,7 @@ function handleNull(errors) {
726
729
  if (errors.length) {
727
730
  if (errors.some(error => !error.path || error.path.length < 2)) {
728
731
  if (errors.length > 1) {
729
- const combinedError = new utils.CombinedError(errors);
732
+ const combinedError = new AggregateError(errors);
730
733
  return combinedError;
731
734
  }
732
735
  const error = errors[0];
@@ -1281,7 +1284,7 @@ function validateRequest(targetSchema, document) {
1281
1284
  const errors = graphql.validate(targetSchema, document);
1282
1285
  if (errors.length > 0) {
1283
1286
  if (errors.length > 1) {
1284
- const combinedError = new utils.CombinedError(errors);
1287
+ const combinedError = new AggregateError(errors);
1285
1288
  throw combinedError;
1286
1289
  }
1287
1290
  const error = errors[0];