@graphql-tools/delegate 9.0.0-alpha-72b86629.0 → 9.0.0-alpha-f6c67111.0
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/externalObjects.d.ts +1 -1
- package/getMergedParent.d.ts +1 -1
- package/index.js +28 -35
- package/index.mjs +28 -35
- package/package.json +4 -4
package/externalObjects.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLError, GraphQLFieldMap, GraphQLResolveInfo, GraphQLSchema } from 'graphql';
|
|
2
2
|
import { ExternalObject, SubschemaConfig } from './types';
|
|
3
3
|
export declare function isExternalObject(data: any): data is ExternalObject;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function annotateExternalObject<TContext = Record<string, any>>(object: any, errors: Array<GraphQLError>, initialPath: Array<string | number>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, info?: GraphQLResolveInfo): ExternalObject;
|
|
5
5
|
export declare function getInitialPath(object: ExternalObject): Array<string | number>;
|
|
6
6
|
export declare function getInitialPossibleFields(object: ExternalObject): GraphQLFieldMap<any, any>;
|
|
7
7
|
export declare function getInfo(object: ExternalObject): GraphQLResolveInfo;
|
package/getMergedParent.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FieldNode, GraphQLResolveInfo, GraphQLSchema } from 'graphql';
|
|
|
2
2
|
import { ExternalObject, MergedTypeInfo } from './types';
|
|
3
3
|
import { Subschema } from './Subschema';
|
|
4
4
|
export declare function getMergedParent(parent: ExternalObject, context: Record<string, any>, info: GraphQLResolveInfo): Promise<ExternalObject>;
|
|
5
|
-
export declare const buildDelegationPlan: (mergedTypeInfo: MergedTypeInfo,
|
|
5
|
+
export declare const buildDelegationPlan: (mergedTypeInfo: MergedTypeInfo, gatewaySchema: GraphQLSchema, sourceSubschema: Subschema, ...fieldNodeArrays: Array<ReadonlyArray<FieldNode>>) => {
|
|
6
6
|
requiredKeys: Record<string, Set<string>>;
|
|
7
7
|
delegationMaps: Array<Map<Subschema, Array<FieldNode>>>;
|
|
8
8
|
stageMap: Record<string, number>;
|
package/index.js
CHANGED
|
@@ -858,7 +858,7 @@ const RESPONSE_KEY_SUBSCHEMA_MAP_SYMBOL = Symbol('subschemaMap');
|
|
|
858
858
|
function isExternalObject(data) {
|
|
859
859
|
return (data === null || data === void 0 ? void 0 : data[UNPATHED_ERRORS_SYMBOL]) !== undefined;
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function annotateExternalObject(object, errors, initialPath, subschema, info) {
|
|
862
862
|
var _a, _b, _c;
|
|
863
863
|
if (isExternalObject(object)) {
|
|
864
864
|
return object;
|
|
@@ -977,7 +977,7 @@ function createExternalValue(data, unpathedErrors, initialPath, subschema, conte
|
|
|
977
977
|
return type.parseValue(data);
|
|
978
978
|
}
|
|
979
979
|
else if (graphql.isCompositeType(type)) {
|
|
980
|
-
return
|
|
980
|
+
return annotateExternalObject(data, unpathedErrors, initialPath, subschema, info);
|
|
981
981
|
}
|
|
982
982
|
else if (graphql.isListType(type)) {
|
|
983
983
|
return createExternalList(type, data, unpathedErrors, initialPath, subschema, context, info);
|
|
@@ -1000,7 +1000,7 @@ function createExternalListMember(type, listMember, unpathedErrors, initialPath,
|
|
|
1000
1000
|
return type.parseValue(listMember);
|
|
1001
1001
|
}
|
|
1002
1002
|
else if (graphql.isCompositeType(type)) {
|
|
1003
|
-
return
|
|
1003
|
+
return annotateExternalObject(listMember, unpathedErrors, initialPath, subschema, info);
|
|
1004
1004
|
}
|
|
1005
1005
|
else if (graphql.isListType(type)) {
|
|
1006
1006
|
return createExternalList(type, listMember, unpathedErrors, initialPath, subschema, context, info);
|
|
@@ -1043,7 +1043,7 @@ function getReturnType(info) {
|
|
|
1043
1043
|
return info.returnType;
|
|
1044
1044
|
}
|
|
1045
1045
|
|
|
1046
|
-
const
|
|
1046
|
+
const getMergedTypeInfo = utils.memoize1(function getMergedTypeInfo(info) {
|
|
1047
1047
|
var _a;
|
|
1048
1048
|
const schema = info.schema;
|
|
1049
1049
|
const stitchingInfo = (_a = schema.extensions) === null || _a === void 0 ? void 0 : _a['stitchingInfo'];
|
|
@@ -1055,60 +1055,52 @@ const getMergeDetails = utils.memoize1(function getMergeDetails(info) {
|
|
|
1055
1055
|
if (mergedTypeInfo === undefined) {
|
|
1056
1056
|
return;
|
|
1057
1057
|
}
|
|
1058
|
-
return
|
|
1059
|
-
stitchingInfo,
|
|
1060
|
-
mergedTypeInfo,
|
|
1061
|
-
};
|
|
1058
|
+
return mergedTypeInfo;
|
|
1062
1059
|
});
|
|
1063
1060
|
const loaders = new WeakMap();
|
|
1064
1061
|
async function getMergedParent(parent, context, info) {
|
|
1065
|
-
const
|
|
1066
|
-
if (!
|
|
1062
|
+
const mergedTypeInfo = getMergedTypeInfo(info);
|
|
1063
|
+
if (!mergedTypeInfo) {
|
|
1067
1064
|
return parent;
|
|
1068
1065
|
}
|
|
1069
|
-
const { mergedTypeInfo } = mergeDetails;
|
|
1070
1066
|
// In the stitching context, all subschemas are compiled Subschema objects rather than SubschemaConfig objects
|
|
1071
1067
|
const sourceSubschema = getObjectSubchema(parent);
|
|
1072
|
-
const targetSubschemas = mergedTypeInfo.targetSubschemas.get(sourceSubschema);
|
|
1073
|
-
if (targetSubschemas === undefined || targetSubschemas.length === 0) {
|
|
1074
|
-
return parent;
|
|
1075
|
-
}
|
|
1076
1068
|
let loader = loaders.get(parent);
|
|
1077
1069
|
if (loader === undefined) {
|
|
1078
|
-
loader = new DataLoader(
|
|
1070
|
+
loader = new DataLoader(fieldNodeArrays => getMergedParentsFromFieldNodes(parent, context, info.schema, fieldNodeArrays, mergedTypeInfo, sourceSubschema));
|
|
1079
1071
|
loaders.set(parent, loader);
|
|
1080
1072
|
}
|
|
1081
|
-
return loader.load(info);
|
|
1073
|
+
return loader.load(info.fieldNodes);
|
|
1082
1074
|
}
|
|
1083
|
-
async function
|
|
1084
|
-
const { requiredKeys, delegationMaps, stageMap } = buildDelegationPlan(mergedTypeInfo,
|
|
1075
|
+
async function getMergedParentsFromFieldNodes(parent, context, gatewaySchema, fieldNodeArrays, mergedTypeInfo, sourceSubschema) {
|
|
1076
|
+
const { requiredKeys, delegationMaps, stageMap } = buildDelegationPlan(mergedTypeInfo, gatewaySchema, sourceSubschema, ...fieldNodeArrays);
|
|
1085
1077
|
if (!delegationMaps.length) {
|
|
1086
|
-
return Array(
|
|
1078
|
+
return Array(fieldNodeArrays.length).fill(parent);
|
|
1087
1079
|
}
|
|
1088
1080
|
const promises = [];
|
|
1089
1081
|
const parentInfo = getInfo(parent);
|
|
1090
|
-
const
|
|
1091
|
-
const type = schema.getType(parent.__typename);
|
|
1082
|
+
const type = gatewaySchema.getType(parent.__typename);
|
|
1092
1083
|
const parentPath = graphql.responsePathAsArray(parentInfo.path);
|
|
1093
|
-
let promise = executeDelegationStage(delegationMaps[0],
|
|
1084
|
+
let promise = executeDelegationStage(delegationMaps[0], gatewaySchema, type, mergedTypeInfo, context, parent, parentInfo, parentPath);
|
|
1094
1085
|
promises.push(promise);
|
|
1095
1086
|
for (let i = 1, delegationStage = delegationMaps[i]; i < delegationMaps.length; i++) {
|
|
1096
|
-
promise = promise.then(parent => executeDelegationStage(delegationStage,
|
|
1087
|
+
promise = promise.then(parent => executeDelegationStage(delegationStage, gatewaySchema, type, mergedTypeInfo, context, parent, parentInfo, parentPath));
|
|
1097
1088
|
promises.push(promise);
|
|
1098
1089
|
}
|
|
1099
|
-
return
|
|
1100
|
-
const
|
|
1090
|
+
return fieldNodeArrays.map(fieldNodeArray => {
|
|
1091
|
+
const fieldName = fieldNodeArray[0].name.value;
|
|
1092
|
+
const keys = requiredKeys[fieldName];
|
|
1101
1093
|
if (keys === undefined) {
|
|
1102
|
-
const delegationStage = stageMap[
|
|
1094
|
+
const delegationStage = stageMap[fieldName];
|
|
1103
1095
|
if (delegationStage !== undefined) {
|
|
1104
|
-
return promises[delegationStage]
|
|
1096
|
+
return promises[delegationStage];
|
|
1105
1097
|
}
|
|
1106
1098
|
return Promise.resolve(parent);
|
|
1107
1099
|
}
|
|
1108
1100
|
return Promise.all(Array.from(keys.values()).map(fieldName => {
|
|
1109
1101
|
const delegationStage = stageMap[fieldName];
|
|
1110
1102
|
if (delegationStage !== undefined) {
|
|
1111
|
-
return promises[delegationStage]
|
|
1103
|
+
return promises[delegationStage];
|
|
1112
1104
|
}
|
|
1113
1105
|
return Promise.resolve(parent);
|
|
1114
1106
|
})).then(() => parent);
|
|
@@ -1155,12 +1147,12 @@ function calculateDelegationStage(mergedTypeInfo, sourceSubschemas, targetSubsch
|
|
|
1155
1147
|
unproxiableFieldNodes,
|
|
1156
1148
|
};
|
|
1157
1149
|
}
|
|
1158
|
-
const buildDelegationPlan = utils.memoize4ofMany(function buildDelegationPlan(mergedTypeInfo,
|
|
1150
|
+
const buildDelegationPlan = utils.memoize4ofMany(function buildDelegationPlan(mergedTypeInfo, gatewaySchema, sourceSubschema, ...fieldNodeArrays) {
|
|
1159
1151
|
var _a, _b, _c;
|
|
1160
1152
|
const requiredKeys = Object.create(null);
|
|
1161
1153
|
const delegationMaps = [];
|
|
1162
1154
|
const stageMap = Object.create(null);
|
|
1163
|
-
const stitchingInfo = (_a =
|
|
1155
|
+
const stitchingInfo = (_a = gatewaySchema.extensions) === null || _a === void 0 ? void 0 : _a['stitchingInfo'];
|
|
1164
1156
|
if (stitchingInfo == null) {
|
|
1165
1157
|
return { requiredKeys, delegationMaps, stageMap };
|
|
1166
1158
|
}
|
|
@@ -1337,20 +1329,21 @@ async function executeDelegationStage(delegationMap, schema, type, mergedTypeInf
|
|
|
1337
1329
|
}
|
|
1338
1330
|
source = nullResult;
|
|
1339
1331
|
}
|
|
1340
|
-
// TODO: fold this assign into loop below?
|
|
1341
|
-
Object.assign(object, source);
|
|
1342
1332
|
// TODO: is this check necessary or just to make TS happy?
|
|
1343
1333
|
if (!isExternalObject(source)) {
|
|
1344
|
-
|
|
1334
|
+
Object.assign(object, source);
|
|
1335
|
+
return object;
|
|
1345
1336
|
}
|
|
1346
1337
|
const objectSubschema = getObjectSubchema(source);
|
|
1347
1338
|
const subschemaMap = getSubschemaMap(source);
|
|
1348
1339
|
for (const responseKey in source) {
|
|
1340
|
+
object[responseKey] = source[responseKey];
|
|
1349
1341
|
newSubschemaMap[responseKey] = (_a = subschemaMap === null || subschemaMap === void 0 ? void 0 : subschemaMap[responseKey]) !== null && _a !== void 0 ? _a : objectSubschema;
|
|
1350
1342
|
}
|
|
1351
1343
|
unpathedErrors.push(...getUnpathedErrors(source));
|
|
1352
1344
|
}
|
|
1353
1345
|
}));
|
|
1346
|
+
return object;
|
|
1354
1347
|
}
|
|
1355
1348
|
const subschemaTypesContainSelectionSet = utils.memoize3(function subschemaTypesContainSelectionSet(mergedTypeInfo, sourceSubschemas, selectionSet) {
|
|
1356
1349
|
return typesContainSelectionSet(sourceSubschemas.map(sourceSubschema => sourceSubschema.transformedSchema.getType(mergedTypeInfo.typeName)), selectionSet);
|
|
@@ -1602,11 +1595,11 @@ function cloneSubschemaConfig(subschemaConfig) {
|
|
|
1602
1595
|
|
|
1603
1596
|
exports.Subschema = Subschema;
|
|
1604
1597
|
exports.Transformer = Transformer;
|
|
1598
|
+
exports.annotateExternalObject = annotateExternalObject;
|
|
1605
1599
|
exports.applySchemaTransforms = applySchemaTransforms;
|
|
1606
1600
|
exports.buildDelegationPlan = buildDelegationPlan;
|
|
1607
1601
|
exports.cloneSubschemaConfig = cloneSubschemaConfig;
|
|
1608
1602
|
exports.createDefaultExecutor = createDefaultExecutor;
|
|
1609
|
-
exports.createExternalObject = createExternalObject;
|
|
1610
1603
|
exports.createExternalValue = createExternalValue;
|
|
1611
1604
|
exports.createRequest = createRequest;
|
|
1612
1605
|
exports.createRequestFromInfo = createRequestFromInfo;
|
package/index.mjs
CHANGED
|
@@ -852,7 +852,7 @@ const RESPONSE_KEY_SUBSCHEMA_MAP_SYMBOL = Symbol('subschemaMap');
|
|
|
852
852
|
function isExternalObject(data) {
|
|
853
853
|
return (data === null || data === void 0 ? void 0 : data[UNPATHED_ERRORS_SYMBOL]) !== undefined;
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function annotateExternalObject(object, errors, initialPath, subschema, info) {
|
|
856
856
|
var _a, _b, _c;
|
|
857
857
|
if (isExternalObject(object)) {
|
|
858
858
|
return object;
|
|
@@ -971,7 +971,7 @@ function createExternalValue(data, unpathedErrors, initialPath, subschema, conte
|
|
|
971
971
|
return type.parseValue(data);
|
|
972
972
|
}
|
|
973
973
|
else if (isCompositeType(type)) {
|
|
974
|
-
return
|
|
974
|
+
return annotateExternalObject(data, unpathedErrors, initialPath, subschema, info);
|
|
975
975
|
}
|
|
976
976
|
else if (isListType(type)) {
|
|
977
977
|
return createExternalList(type, data, unpathedErrors, initialPath, subschema, context, info);
|
|
@@ -994,7 +994,7 @@ function createExternalListMember(type, listMember, unpathedErrors, initialPath,
|
|
|
994
994
|
return type.parseValue(listMember);
|
|
995
995
|
}
|
|
996
996
|
else if (isCompositeType(type)) {
|
|
997
|
-
return
|
|
997
|
+
return annotateExternalObject(listMember, unpathedErrors, initialPath, subschema, info);
|
|
998
998
|
}
|
|
999
999
|
else if (isListType(type)) {
|
|
1000
1000
|
return createExternalList(type, listMember, unpathedErrors, initialPath, subschema, context, info);
|
|
@@ -1037,7 +1037,7 @@ function getReturnType(info) {
|
|
|
1037
1037
|
return info.returnType;
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
|
-
const
|
|
1040
|
+
const getMergedTypeInfo = memoize1(function getMergedTypeInfo(info) {
|
|
1041
1041
|
var _a;
|
|
1042
1042
|
const schema = info.schema;
|
|
1043
1043
|
const stitchingInfo = (_a = schema.extensions) === null || _a === void 0 ? void 0 : _a['stitchingInfo'];
|
|
@@ -1049,60 +1049,52 @@ const getMergeDetails = memoize1(function getMergeDetails(info) {
|
|
|
1049
1049
|
if (mergedTypeInfo === undefined) {
|
|
1050
1050
|
return;
|
|
1051
1051
|
}
|
|
1052
|
-
return
|
|
1053
|
-
stitchingInfo,
|
|
1054
|
-
mergedTypeInfo,
|
|
1055
|
-
};
|
|
1052
|
+
return mergedTypeInfo;
|
|
1056
1053
|
});
|
|
1057
1054
|
const loaders = new WeakMap();
|
|
1058
1055
|
async function getMergedParent(parent, context, info) {
|
|
1059
|
-
const
|
|
1060
|
-
if (!
|
|
1056
|
+
const mergedTypeInfo = getMergedTypeInfo(info);
|
|
1057
|
+
if (!mergedTypeInfo) {
|
|
1061
1058
|
return parent;
|
|
1062
1059
|
}
|
|
1063
|
-
const { mergedTypeInfo } = mergeDetails;
|
|
1064
1060
|
// In the stitching context, all subschemas are compiled Subschema objects rather than SubschemaConfig objects
|
|
1065
1061
|
const sourceSubschema = getObjectSubchema(parent);
|
|
1066
|
-
const targetSubschemas = mergedTypeInfo.targetSubschemas.get(sourceSubschema);
|
|
1067
|
-
if (targetSubschemas === undefined || targetSubschemas.length === 0) {
|
|
1068
|
-
return parent;
|
|
1069
|
-
}
|
|
1070
1062
|
let loader = loaders.get(parent);
|
|
1071
1063
|
if (loader === undefined) {
|
|
1072
|
-
loader = new DataLoader(
|
|
1064
|
+
loader = new DataLoader(fieldNodeArrays => getMergedParentsFromFieldNodes(parent, context, info.schema, fieldNodeArrays, mergedTypeInfo, sourceSubschema));
|
|
1073
1065
|
loaders.set(parent, loader);
|
|
1074
1066
|
}
|
|
1075
|
-
return loader.load(info);
|
|
1067
|
+
return loader.load(info.fieldNodes);
|
|
1076
1068
|
}
|
|
1077
|
-
async function
|
|
1078
|
-
const { requiredKeys, delegationMaps, stageMap } = buildDelegationPlan(mergedTypeInfo,
|
|
1069
|
+
async function getMergedParentsFromFieldNodes(parent, context, gatewaySchema, fieldNodeArrays, mergedTypeInfo, sourceSubschema) {
|
|
1070
|
+
const { requiredKeys, delegationMaps, stageMap } = buildDelegationPlan(mergedTypeInfo, gatewaySchema, sourceSubschema, ...fieldNodeArrays);
|
|
1079
1071
|
if (!delegationMaps.length) {
|
|
1080
|
-
return Array(
|
|
1072
|
+
return Array(fieldNodeArrays.length).fill(parent);
|
|
1081
1073
|
}
|
|
1082
1074
|
const promises = [];
|
|
1083
1075
|
const parentInfo = getInfo(parent);
|
|
1084
|
-
const
|
|
1085
|
-
const type = schema.getType(parent.__typename);
|
|
1076
|
+
const type = gatewaySchema.getType(parent.__typename);
|
|
1086
1077
|
const parentPath = responsePathAsArray(parentInfo.path);
|
|
1087
|
-
let promise = executeDelegationStage(delegationMaps[0],
|
|
1078
|
+
let promise = executeDelegationStage(delegationMaps[0], gatewaySchema, type, mergedTypeInfo, context, parent, parentInfo, parentPath);
|
|
1088
1079
|
promises.push(promise);
|
|
1089
1080
|
for (let i = 1, delegationStage = delegationMaps[i]; i < delegationMaps.length; i++) {
|
|
1090
|
-
promise = promise.then(parent => executeDelegationStage(delegationStage,
|
|
1081
|
+
promise = promise.then(parent => executeDelegationStage(delegationStage, gatewaySchema, type, mergedTypeInfo, context, parent, parentInfo, parentPath));
|
|
1091
1082
|
promises.push(promise);
|
|
1092
1083
|
}
|
|
1093
|
-
return
|
|
1094
|
-
const
|
|
1084
|
+
return fieldNodeArrays.map(fieldNodeArray => {
|
|
1085
|
+
const fieldName = fieldNodeArray[0].name.value;
|
|
1086
|
+
const keys = requiredKeys[fieldName];
|
|
1095
1087
|
if (keys === undefined) {
|
|
1096
|
-
const delegationStage = stageMap[
|
|
1088
|
+
const delegationStage = stageMap[fieldName];
|
|
1097
1089
|
if (delegationStage !== undefined) {
|
|
1098
|
-
return promises[delegationStage]
|
|
1090
|
+
return promises[delegationStage];
|
|
1099
1091
|
}
|
|
1100
1092
|
return Promise.resolve(parent);
|
|
1101
1093
|
}
|
|
1102
1094
|
return Promise.all(Array.from(keys.values()).map(fieldName => {
|
|
1103
1095
|
const delegationStage = stageMap[fieldName];
|
|
1104
1096
|
if (delegationStage !== undefined) {
|
|
1105
|
-
return promises[delegationStage]
|
|
1097
|
+
return promises[delegationStage];
|
|
1106
1098
|
}
|
|
1107
1099
|
return Promise.resolve(parent);
|
|
1108
1100
|
})).then(() => parent);
|
|
@@ -1149,12 +1141,12 @@ function calculateDelegationStage(mergedTypeInfo, sourceSubschemas, targetSubsch
|
|
|
1149
1141
|
unproxiableFieldNodes,
|
|
1150
1142
|
};
|
|
1151
1143
|
}
|
|
1152
|
-
const buildDelegationPlan = memoize4ofMany(function buildDelegationPlan(mergedTypeInfo,
|
|
1144
|
+
const buildDelegationPlan = memoize4ofMany(function buildDelegationPlan(mergedTypeInfo, gatewaySchema, sourceSubschema, ...fieldNodeArrays) {
|
|
1153
1145
|
var _a, _b, _c;
|
|
1154
1146
|
const requiredKeys = Object.create(null);
|
|
1155
1147
|
const delegationMaps = [];
|
|
1156
1148
|
const stageMap = Object.create(null);
|
|
1157
|
-
const stitchingInfo = (_a =
|
|
1149
|
+
const stitchingInfo = (_a = gatewaySchema.extensions) === null || _a === void 0 ? void 0 : _a['stitchingInfo'];
|
|
1158
1150
|
if (stitchingInfo == null) {
|
|
1159
1151
|
return { requiredKeys, delegationMaps, stageMap };
|
|
1160
1152
|
}
|
|
@@ -1331,20 +1323,21 @@ async function executeDelegationStage(delegationMap, schema, type, mergedTypeInf
|
|
|
1331
1323
|
}
|
|
1332
1324
|
source = nullResult;
|
|
1333
1325
|
}
|
|
1334
|
-
// TODO: fold this assign into loop below?
|
|
1335
|
-
Object.assign(object, source);
|
|
1336
1326
|
// TODO: is this check necessary or just to make TS happy?
|
|
1337
1327
|
if (!isExternalObject(source)) {
|
|
1338
|
-
|
|
1328
|
+
Object.assign(object, source);
|
|
1329
|
+
return object;
|
|
1339
1330
|
}
|
|
1340
1331
|
const objectSubschema = getObjectSubchema(source);
|
|
1341
1332
|
const subschemaMap = getSubschemaMap(source);
|
|
1342
1333
|
for (const responseKey in source) {
|
|
1334
|
+
object[responseKey] = source[responseKey];
|
|
1343
1335
|
newSubschemaMap[responseKey] = (_a = subschemaMap === null || subschemaMap === void 0 ? void 0 : subschemaMap[responseKey]) !== null && _a !== void 0 ? _a : objectSubschema;
|
|
1344
1336
|
}
|
|
1345
1337
|
unpathedErrors.push(...getUnpathedErrors(source));
|
|
1346
1338
|
}
|
|
1347
1339
|
}));
|
|
1340
|
+
return object;
|
|
1348
1341
|
}
|
|
1349
1342
|
const subschemaTypesContainSelectionSet = memoize3(function subschemaTypesContainSelectionSet(mergedTypeInfo, sourceSubschemas, selectionSet) {
|
|
1350
1343
|
return typesContainSelectionSet(sourceSubschemas.map(sourceSubschema => sourceSubschema.transformedSchema.getType(mergedTypeInfo.typeName)), selectionSet);
|
|
@@ -1594,4 +1587,4 @@ function cloneSubschemaConfig(subschemaConfig) {
|
|
|
1594
1587
|
return newSubschemaConfig;
|
|
1595
1588
|
}
|
|
1596
1589
|
|
|
1597
|
-
export { Subschema, Transformer, applySchemaTransforms, buildDelegationPlan, cloneSubschemaConfig, createDefaultExecutor,
|
|
1590
|
+
export { Subschema, Transformer, annotateExternalObject, applySchemaTransforms, buildDelegationPlan, cloneSubschemaConfig, createDefaultExecutor, createExternalValue, createRequest, createRequestFromInfo, defaultMergedResolver, delegateRequest, delegateToSchema, externalValueFromResult, getDelegatingOperation, getDelegationContext, getExecutor, getInfo, getInitialPath, getInitialPossibleFields, getMergedParent, getObjectSubchema, getSubschema, getSubschemaMap, getUnpathedErrors, isExternalObject, isSubschema, isSubschemaConfig, validateRequest };
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/delegate",
|
|
3
|
-
"version": "9.0.0-alpha-
|
|
3
|
+
"version": "9.0.0-alpha-f6c67111.0",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/batch-execute": "8.1.1-alpha-
|
|
11
|
-
"@graphql-tools/schema": "8.2.1-alpha-
|
|
12
|
-
"@graphql-tools/utils": "9.0.0-alpha-
|
|
10
|
+
"@graphql-tools/batch-execute": "8.1.1-alpha-f6c67111.0",
|
|
11
|
+
"@graphql-tools/schema": "8.2.1-alpha-f6c67111.0",
|
|
12
|
+
"@graphql-tools/utils": "9.0.0-alpha-f6c67111.0",
|
|
13
13
|
"dataloader": "2.0.0",
|
|
14
14
|
"tslib": "~2.3.0",
|
|
15
15
|
"value-or-promise": "1.0.10"
|