@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/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cloneSchema, serializeInputValue, updateArgument, collectFields, relocatedError, mergeDeep, getResponseKeyFromInfo, implementsAbstractType, mapAsyncIterator } from '@graphql-tools/utils';
|
|
2
2
|
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';
|
|
3
|
+
import AggregateError from '@ardatan/aggregate-error';
|
|
3
4
|
import isPromise from 'is-promise';
|
|
4
|
-
import AggregateError$1 from '@ardatan/aggregate-error';
|
|
5
5
|
import { getBatchingExecutor } from '@graphql-tools/batch-execute';
|
|
6
6
|
|
|
7
7
|
function applySchemaTransforms(originalWrappingSchema, subschemaConfig, transformedSchema) {
|
|
@@ -560,7 +560,8 @@ function mergeFields(mergedTypeInfo, typeName, object, fieldNodes, sourceSubsche
|
|
|
560
560
|
let containsPromises = false;
|
|
561
561
|
const resultMap = new Map();
|
|
562
562
|
delegationMap.forEach((selectionSet, s) => {
|
|
563
|
-
const
|
|
563
|
+
const resolver = mergedTypeInfo.resolvers.get(s);
|
|
564
|
+
const maybePromise = resolver(object, context, info, s, selectionSet);
|
|
564
565
|
resultMap.set(maybePromise, selectionSet);
|
|
565
566
|
if (isPromise(maybePromise)) {
|
|
566
567
|
containsPromises = true;
|
|
@@ -1390,7 +1391,7 @@ function mergeDataAndErrors(data, errors, path, index = 1) {
|
|
|
1390
1391
|
const newPath = path === undefined ? error.path : error.path === undefined ? path : path.concat(error.path.slice(1));
|
|
1391
1392
|
return { data: relocatedError(errors[0], newPath), unpathedErrors: [] };
|
|
1392
1393
|
}
|
|
1393
|
-
return { data: locatedError(new AggregateError
|
|
1394
|
+
return { data: locatedError(new AggregateError(errors), undefined, path), unpathedErrors: [] };
|
|
1394
1395
|
}
|
|
1395
1396
|
if (!errors.length) {
|
|
1396
1397
|
return { data, unpathedErrors: [] };
|
|
@@ -1691,7 +1692,7 @@ function validateRequest(targetSchema, document) {
|
|
|
1691
1692
|
const errors = validate(targetSchema, document);
|
|
1692
1693
|
if (errors.length > 0) {
|
|
1693
1694
|
if (errors.length > 1) {
|
|
1694
|
-
const combinedError = new AggregateError
|
|
1695
|
+
const combinedError = new AggregateError(errors);
|
|
1695
1696
|
throw combinedError;
|
|
1696
1697
|
}
|
|
1697
1698
|
const error = errors[0];
|