@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.cjs.js +5 -4
- package/es5/index.cjs.js.map +1 -1
- package/es5/index.esm.js +5 -4
- package/es5/index.esm.js.map +1 -1
- package/es5/package.json +1 -1
- package/es5/types.d.ts +6 -3
- package/index.cjs.js +5 -4
- package/index.cjs.js.map +1 -1
- package/index.esm.js +5 -4
- package/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +6 -3
package/es5/index.cjs.js
CHANGED
|
@@ -7,8 +7,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
const utils = require('@graphql-tools/utils/es5');
|
|
8
8
|
const tslib = require('tslib');
|
|
9
9
|
const graphql = require('graphql');
|
|
10
|
+
const AggregateError = _interopDefault(require('@ardatan/aggregate-error'));
|
|
10
11
|
const isPromise = _interopDefault(require('is-promise'));
|
|
11
|
-
const AggregateError$1 = _interopDefault(require('@ardatan/aggregate-error'));
|
|
12
12
|
const batchExecute = require('@graphql-tools/batch-execute/es5');
|
|
13
13
|
|
|
14
14
|
function applySchemaTransforms(originalWrappingSchema, subschemaConfig, transformedSchema) {
|
|
@@ -570,7 +570,8 @@ function mergeFields(mergedTypeInfo, typeName, object, fieldNodes, sourceSubsche
|
|
|
570
570
|
var containsPromises = false;
|
|
571
571
|
var resultMap = new Map();
|
|
572
572
|
delegationMap.forEach(function (selectionSet, s) {
|
|
573
|
-
var
|
|
573
|
+
var resolver = mergedTypeInfo.resolvers.get(s);
|
|
574
|
+
var maybePromise = resolver(object, context, info, s, selectionSet);
|
|
574
575
|
resultMap.set(maybePromise, selectionSet);
|
|
575
576
|
if (isPromise(maybePromise)) {
|
|
576
577
|
containsPromises = true;
|
|
@@ -1417,7 +1418,7 @@ function mergeDataAndErrors(data, errors, path, index) {
|
|
|
1417
1418
|
var newPath = path === undefined ? error.path : error.path === undefined ? path : path.concat(error.path.slice(1));
|
|
1418
1419
|
return { data: utils.relocatedError(errors[0], newPath), unpathedErrors: [] };
|
|
1419
1420
|
}
|
|
1420
|
-
return { data: graphql.locatedError(new AggregateError
|
|
1421
|
+
return { data: graphql.locatedError(new AggregateError(errors), undefined, path), unpathedErrors: [] };
|
|
1421
1422
|
}
|
|
1422
1423
|
if (!errors.length) {
|
|
1423
1424
|
return { data: data, unpathedErrors: [] };
|
|
@@ -1713,7 +1714,7 @@ function validateRequest(targetSchema, document) {
|
|
|
1713
1714
|
var errors = graphql.validate(targetSchema, document);
|
|
1714
1715
|
if (errors.length > 0) {
|
|
1715
1716
|
if (errors.length > 1) {
|
|
1716
|
-
var combinedError = new AggregateError
|
|
1717
|
+
var combinedError = new AggregateError(errors);
|
|
1717
1718
|
throw combinedError;
|
|
1718
1719
|
}
|
|
1719
1720
|
var error = errors[0];
|