@depup/graphql-tools__delegate 12.1.1-depup.1 → 12.1.3-depup.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/README.md +2 -2
- package/changes.json +1 -1
- package/dist/index.cjs +51 -13
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +52 -13
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/graphql-tools__delegate
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@graphql-tools/delegate](https://www.npmjs.com/package/@graphql-tools/delegate) @ 12.1.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [@graphql-tools/delegate](https://www.npmjs.com/package/@graphql-tools/delegate) @ 12.1.3 |
|
|
17
|
+
| Processed | 2026-09-03 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 4 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -57,6 +57,16 @@ class Subschema {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
function getCoercedVariableValues(variableValues) {
|
|
61
|
+
if (variableValues == null) {
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
if (Object.hasOwn(variableValues, "coerced") && Object.hasOwn(variableValues, "sources")) {
|
|
65
|
+
return variableValues.coerced;
|
|
66
|
+
}
|
|
67
|
+
return variableValues;
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
const prototypePollutingKeys = [
|
|
61
71
|
"__proto__",
|
|
62
72
|
"constructor",
|
|
@@ -96,18 +106,18 @@ function getSubschema(object, responseKey) {
|
|
|
96
106
|
function getUnpathedErrors(object) {
|
|
97
107
|
return object[UNPATHED_ERRORS_SYMBOL];
|
|
98
108
|
}
|
|
99
|
-
const EMPTY_ARRAY = [];
|
|
100
109
|
const EMPTY_OBJECT = /* @__PURE__ */ Object.create(null);
|
|
101
110
|
const getActualFieldNodes = utils.memoize1(function(fieldNode) {
|
|
102
111
|
return [fieldNode];
|
|
103
112
|
});
|
|
104
|
-
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info) {
|
|
113
|
+
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info, fieldNodes = info.fieldNodes) {
|
|
114
|
+
const variableValues = getCoercedVariableValues(info.variableValues);
|
|
105
115
|
const delegationMaps = mergedTypeInfo.delegationPlanBuilder(
|
|
106
116
|
info.schema,
|
|
107
117
|
sourceSubschema,
|
|
108
|
-
|
|
118
|
+
variableValues != null && Object.keys(variableValues).length > 0 ? variableValues : EMPTY_OBJECT,
|
|
109
119
|
info.fragments != null && Object.keys(info.fragments).length > 0 ? info.fragments : EMPTY_OBJECT,
|
|
110
|
-
|
|
120
|
+
fieldNodes.length === 1 && fieldNodes[0] ? getActualFieldNodes(fieldNodes[0]) : fieldNodes,
|
|
111
121
|
context,
|
|
112
122
|
info
|
|
113
123
|
);
|
|
@@ -137,7 +147,7 @@ function handleResolverResult(resolverResult, subschema, selectionSet, object, c
|
|
|
137
147
|
const { fields } = utils.collectFields(
|
|
138
148
|
schema,
|
|
139
149
|
info.fragments,
|
|
140
|
-
info.variableValues,
|
|
150
|
+
getCoercedVariableValues(info.variableValues) ?? EMPTY_OBJECT,
|
|
141
151
|
type,
|
|
142
152
|
selectionSet
|
|
143
153
|
);
|
|
@@ -821,7 +831,9 @@ function finalizeGatewayRequest(originalRequest, delegationContext, onOverlappin
|
|
|
821
831
|
delegationContext
|
|
822
832
|
);
|
|
823
833
|
const newVariables = {};
|
|
824
|
-
const outerVariables =
|
|
834
|
+
const outerVariables = getCoercedVariableValues(
|
|
835
|
+
delegationContext.info?.variableValues
|
|
836
|
+
);
|
|
825
837
|
for (const varName of usedVariables) {
|
|
826
838
|
const existingVar = originalRequest.variables?.[varName];
|
|
827
839
|
const outerVar = outerVariables?.[varName];
|
|
@@ -2341,7 +2353,8 @@ function createRequest({
|
|
|
2341
2353
|
`Either "targetFieldName" or a non empty "fieldNodes" array must be provided.`
|
|
2342
2354
|
);
|
|
2343
2355
|
}
|
|
2344
|
-
const
|
|
2356
|
+
const outerVariableValues = getCoercedVariableValues(info?.variableValues);
|
|
2357
|
+
const newVariables = outerVariableValues ? { ...outerVariableValues } : {};
|
|
2345
2358
|
const variableDefinitions = info?.operation.variableDefinitions ? [...info.operation.variableDefinitions] : [];
|
|
2346
2359
|
const argNodes = [];
|
|
2347
2360
|
const replacedVariableNames = /* @__PURE__ */ new Set();
|
|
@@ -2382,7 +2395,7 @@ function createRequest({
|
|
|
2382
2395
|
) || // It should not conflict with the variable on the gateway request
|
|
2383
2396
|
// Because the gateway request can have a variable that has nothing to do with
|
|
2384
2397
|
// this argument
|
|
2385
|
-
|
|
2398
|
+
outerVariableValues?.[varName2] != null;
|
|
2386
2399
|
let varName = argName;
|
|
2387
2400
|
if (varExists(varName)) {
|
|
2388
2401
|
varName = `_${rootFieldName}_${argName}`;
|
|
@@ -2572,9 +2585,9 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2572
2585
|
}
|
|
2573
2586
|
const deferred = promiseHelpers.createDeferredPromise();
|
|
2574
2587
|
missingDeferredFields.set(responseKey, deferred);
|
|
2575
|
-
const
|
|
2576
|
-
const
|
|
2577
|
-
const fieldNodesByType =
|
|
2588
|
+
const stitchingInfo2 = info.schema.extensions?.["stitchingInfo"];
|
|
2589
|
+
const parentTypeName2 = parent?.__typename || info.parentType.name;
|
|
2590
|
+
const fieldNodesByType = stitchingInfo2?.fieldNodesByField?.[parentTypeName2]?.[info.fieldName];
|
|
2578
2591
|
if (fieldNodesByType?.every((fieldNode) => {
|
|
2579
2592
|
const responseKey2 = fieldNode.alias?.value ?? fieldNode.name.value;
|
|
2580
2593
|
return Object.prototype.hasOwnProperty.call(parent, responseKey2);
|
|
@@ -2588,6 +2601,29 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2588
2601
|
if (Object.prototype.hasOwnProperty.call(parent, info.fieldName)) {
|
|
2589
2602
|
return graphql.defaultFieldResolver(parent, args, context, info);
|
|
2590
2603
|
}
|
|
2604
|
+
const stitchingInfo = info.schema?.extensions?.["stitchingInfo"];
|
|
2605
|
+
const parentTypeName = parent.__typename || info.parentType?.name;
|
|
2606
|
+
const mergedTypeInfo = parentTypeName ? stitchingInfo?.mergedTypes[parentTypeName] : void 0;
|
|
2607
|
+
const sourceSubschema = parent[OBJECT_SUBSCHEMA_SYMBOL];
|
|
2608
|
+
if (mergedTypeInfo && sourceSubschema) {
|
|
2609
|
+
const fieldNode = {
|
|
2610
|
+
kind: graphql.Kind.FIELD,
|
|
2611
|
+
name: info.fieldNodes[0]?.name ?? {
|
|
2612
|
+
kind: graphql.Kind.NAME,
|
|
2613
|
+
value: info.fieldName
|
|
2614
|
+
},
|
|
2615
|
+
selectionSet: {
|
|
2616
|
+
kind: graphql.Kind.SELECTION_SET,
|
|
2617
|
+
selections: info.fieldNodes
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
return promiseHelpers.handleMaybePromise(
|
|
2621
|
+
() => mergeFields(mergedTypeInfo, parent, sourceSubschema, context, info, [
|
|
2622
|
+
fieldNode
|
|
2623
|
+
]),
|
|
2624
|
+
() => Object.prototype.hasOwnProperty.call(parent, responseKey) ? handleResult(parent, responseKey, context, info) : void 0
|
|
2625
|
+
);
|
|
2626
|
+
}
|
|
2591
2627
|
return void 0;
|
|
2592
2628
|
}
|
|
2593
2629
|
return handleResult(parent, responseKey, context, info);
|
|
@@ -2717,10 +2753,13 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
2717
2753
|
responseKey
|
|
2718
2754
|
);
|
|
2719
2755
|
if (sourceSubschema && nestedTypeName) {
|
|
2756
|
+
const variableValues = getCoercedVariableValues(
|
|
2757
|
+
info.variableValues
|
|
2758
|
+
);
|
|
2720
2759
|
const delegationPlan = stitchingInfo.mergedTypes[nestedTypeName]?.delegationPlanBuilder(
|
|
2721
2760
|
info.schema,
|
|
2722
2761
|
sourceSubschema,
|
|
2723
|
-
|
|
2762
|
+
variableValues != null && Object.keys(variableValues).length > 0 ? variableValues : EMPTY_OBJECT,
|
|
2724
2763
|
info.fragments != null && Object.keys(info.fragments).length > 0 ? info.fragments : EMPTY_OBJECT,
|
|
2725
2764
|
getActualFieldNodes(fieldNode),
|
|
2726
2765
|
context,
|
|
@@ -3494,7 +3533,6 @@ Object.defineProperty(exports, "createDefaultExecutor", {
|
|
|
3494
3533
|
enumerable: true,
|
|
3495
3534
|
get: function () { return executor.executorFromSchema; }
|
|
3496
3535
|
});
|
|
3497
|
-
exports.EMPTY_ARRAY = EMPTY_ARRAY;
|
|
3498
3536
|
exports.EMPTY_OBJECT = EMPTY_OBJECT;
|
|
3499
3537
|
exports.FIELD_SUBSCHEMA_MAP_SYMBOL = FIELD_SUBSCHEMA_MAP_SYMBOL;
|
|
3500
3538
|
exports.OBJECT_SUBSCHEMA_SYMBOL = OBJECT_SUBSCHEMA_SYMBOL;
|
package/dist/index.d.cts
CHANGED
|
@@ -199,10 +199,9 @@ declare function isExternalObject(data: any): data is ExternalObject;
|
|
|
199
199
|
declare function annotateExternalObject<TContext>(object: any, errors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext> | undefined, subschemaMap: Record<string, GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>>): ExternalObject;
|
|
200
200
|
declare function getSubschema(object: ExternalObject, responseKey: string): GraphQLSchema | SubschemaConfig;
|
|
201
201
|
declare function getUnpathedErrors(object: ExternalObject): Array<GraphQLError>;
|
|
202
|
-
declare const EMPTY_ARRAY: any[];
|
|
203
202
|
declare const EMPTY_OBJECT: any;
|
|
204
203
|
declare const getActualFieldNodes: (fieldNode: FieldNode) => FieldNode[];
|
|
205
|
-
declare function mergeFields<TContext>(mergedTypeInfo: MergedTypeInfo, object: any, sourceSubschema: Subschema<any, any, any, TContext>, context: any, info: GraphQLResolveInfo): MaybePromise<any>;
|
|
204
|
+
declare function mergeFields<TContext>(mergedTypeInfo: MergedTypeInfo, object: any, sourceSubschema: Subschema<any, any, any, TContext>, context: any, info: GraphQLResolveInfo, fieldNodes?: FieldNode[]): MaybePromise<any>;
|
|
206
205
|
declare function handleResolverResult(resolverResult: any, subschema: Subschema, selectionSet: SelectionSetNode, object: ExternalObject, combinedFieldSubschemaMap: Record<string, GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>>, info: GraphQLResolveInfo, path: Array<string | number>, combinedErrors: Array<GraphQLError>): void;
|
|
207
206
|
|
|
208
207
|
declare function resolveExternalValue<TContext extends Record<string, any>>(result: any, unpathedErrors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, context?: Record<string, any>, info?: GraphQLResolveInfo, returnType?: GraphQLOutputType, skipTypeMerging?: boolean): any;
|
|
@@ -239,4 +238,4 @@ declare function isPrototypePollutingKey(key: string): key is PrototypePolluting
|
|
|
239
238
|
|
|
240
239
|
declare const handleOverrideByDelegation: (info: GraphQLResolveInfo$1, context: any, overrideHandler: OverrideHandler) => boolean;
|
|
241
240
|
|
|
242
|
-
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver,
|
|
241
|
+
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver, EMPTY_OBJECT, type ExternalObject, FIELD_SUBSCHEMA_MAP_SYMBOL, type ICreateProxyingResolverOptions, type ICreateRequest, type IDelegateRequestOptions, type IDelegateToSchemaOptions, type MergedFieldConfig, type MergedTypeConfig, type MergedTypeEntryPoint, type MergedTypeInfo, type MergedTypeResolver, type MergedTypeResolverOptions, OBJECT_SUBSCHEMA_SYMBOL, type OverrideHandler, PLAN_LEFT_OVER, type RequestTransform, type ResultTransform, type SchemaTransform, type StitchingInfo, Subschema, type SubschemaConfig, type Transform, Transformer, UNPATHED_ERRORS_SYMBOL, annotateExternalObject, applySchemaTransforms, cloneSubschemaConfig, createRequest, defaultMergedResolver, delegateRequest, delegateToSchema, extractUnavailableFields, extractUnavailableFieldsFromSelectionSet, getActualFieldNodes, getDelegatingOperation, getPlanLeftOverFromParent, getSubschema, getTypeInfo, getTypeInfoWithType, getUnpathedErrors, handleOverrideByDelegation, handleResolverResult, isExternalObject, isPrototypePollutingKey, isSubschema, isSubschemaConfig, leftOverByDelegationPlan, mergeFields, resolveExternalValue, subtractSelectionSets };
|
package/dist/index.d.ts
CHANGED
|
@@ -199,10 +199,9 @@ declare function isExternalObject(data: any): data is ExternalObject;
|
|
|
199
199
|
declare function annotateExternalObject<TContext>(object: any, errors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext> | undefined, subschemaMap: Record<string, GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>>): ExternalObject;
|
|
200
200
|
declare function getSubschema(object: ExternalObject, responseKey: string): GraphQLSchema | SubschemaConfig;
|
|
201
201
|
declare function getUnpathedErrors(object: ExternalObject): Array<GraphQLError>;
|
|
202
|
-
declare const EMPTY_ARRAY: any[];
|
|
203
202
|
declare const EMPTY_OBJECT: any;
|
|
204
203
|
declare const getActualFieldNodes: (fieldNode: FieldNode) => FieldNode[];
|
|
205
|
-
declare function mergeFields<TContext>(mergedTypeInfo: MergedTypeInfo, object: any, sourceSubschema: Subschema<any, any, any, TContext>, context: any, info: GraphQLResolveInfo): MaybePromise<any>;
|
|
204
|
+
declare function mergeFields<TContext>(mergedTypeInfo: MergedTypeInfo, object: any, sourceSubschema: Subschema<any, any, any, TContext>, context: any, info: GraphQLResolveInfo, fieldNodes?: FieldNode[]): MaybePromise<any>;
|
|
206
205
|
declare function handleResolverResult(resolverResult: any, subschema: Subschema, selectionSet: SelectionSetNode, object: ExternalObject, combinedFieldSubschemaMap: Record<string, GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>>, info: GraphQLResolveInfo, path: Array<string | number>, combinedErrors: Array<GraphQLError>): void;
|
|
207
206
|
|
|
208
207
|
declare function resolveExternalValue<TContext extends Record<string, any>>(result: any, unpathedErrors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, context?: Record<string, any>, info?: GraphQLResolveInfo, returnType?: GraphQLOutputType, skipTypeMerging?: boolean): any;
|
|
@@ -239,4 +238,4 @@ declare function isPrototypePollutingKey(key: string): key is PrototypePolluting
|
|
|
239
238
|
|
|
240
239
|
declare const handleOverrideByDelegation: (info: GraphQLResolveInfo$1, context: any, overrideHandler: OverrideHandler) => boolean;
|
|
241
240
|
|
|
242
|
-
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver,
|
|
241
|
+
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver, EMPTY_OBJECT, type ExternalObject, FIELD_SUBSCHEMA_MAP_SYMBOL, type ICreateProxyingResolverOptions, type ICreateRequest, type IDelegateRequestOptions, type IDelegateToSchemaOptions, type MergedFieldConfig, type MergedTypeConfig, type MergedTypeEntryPoint, type MergedTypeInfo, type MergedTypeResolver, type MergedTypeResolverOptions, OBJECT_SUBSCHEMA_SYMBOL, type OverrideHandler, PLAN_LEFT_OVER, type RequestTransform, type ResultTransform, type SchemaTransform, type StitchingInfo, Subschema, type SubschemaConfig, type Transform, Transformer, UNPATHED_ERRORS_SYMBOL, annotateExternalObject, applySchemaTransforms, cloneSubschemaConfig, createRequest, defaultMergedResolver, delegateRequest, delegateToSchema, extractUnavailableFields, extractUnavailableFieldsFromSelectionSet, getActualFieldNodes, getDelegatingOperation, getPlanLeftOverFromParent, getSubschema, getTypeInfo, getTypeInfoWithType, getUnpathedErrors, handleOverrideByDelegation, handleResolverResult, isExternalObject, isPrototypePollutingKey, isSubschema, isSubschemaConfig, leftOverByDelegationPlan, mergeFields, resolveExternalValue, subtractSelectionSets };
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,16 @@ class Subschema {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
function getCoercedVariableValues(variableValues) {
|
|
61
|
+
if (variableValues == null) {
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
if (Object.hasOwn(variableValues, "coerced") && Object.hasOwn(variableValues, "sources")) {
|
|
65
|
+
return variableValues.coerced;
|
|
66
|
+
}
|
|
67
|
+
return variableValues;
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
const prototypePollutingKeys = [
|
|
61
71
|
"__proto__",
|
|
62
72
|
"constructor",
|
|
@@ -96,18 +106,18 @@ function getSubschema(object, responseKey) {
|
|
|
96
106
|
function getUnpathedErrors(object) {
|
|
97
107
|
return object[UNPATHED_ERRORS_SYMBOL];
|
|
98
108
|
}
|
|
99
|
-
const EMPTY_ARRAY = [];
|
|
100
109
|
const EMPTY_OBJECT = /* @__PURE__ */ Object.create(null);
|
|
101
110
|
const getActualFieldNodes = memoize1(function(fieldNode) {
|
|
102
111
|
return [fieldNode];
|
|
103
112
|
});
|
|
104
|
-
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info) {
|
|
113
|
+
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info, fieldNodes = info.fieldNodes) {
|
|
114
|
+
const variableValues = getCoercedVariableValues(info.variableValues);
|
|
105
115
|
const delegationMaps = mergedTypeInfo.delegationPlanBuilder(
|
|
106
116
|
info.schema,
|
|
107
117
|
sourceSubschema,
|
|
108
|
-
|
|
118
|
+
variableValues != null && Object.keys(variableValues).length > 0 ? variableValues : EMPTY_OBJECT,
|
|
109
119
|
info.fragments != null && Object.keys(info.fragments).length > 0 ? info.fragments : EMPTY_OBJECT,
|
|
110
|
-
|
|
120
|
+
fieldNodes.length === 1 && fieldNodes[0] ? getActualFieldNodes(fieldNodes[0]) : fieldNodes,
|
|
111
121
|
context,
|
|
112
122
|
info
|
|
113
123
|
);
|
|
@@ -137,7 +147,7 @@ function handleResolverResult(resolverResult, subschema, selectionSet, object, c
|
|
|
137
147
|
const { fields } = collectFields(
|
|
138
148
|
schema,
|
|
139
149
|
info.fragments,
|
|
140
|
-
info.variableValues,
|
|
150
|
+
getCoercedVariableValues(info.variableValues) ?? EMPTY_OBJECT,
|
|
141
151
|
type,
|
|
142
152
|
selectionSet
|
|
143
153
|
);
|
|
@@ -821,7 +831,9 @@ function finalizeGatewayRequest(originalRequest, delegationContext, onOverlappin
|
|
|
821
831
|
delegationContext
|
|
822
832
|
);
|
|
823
833
|
const newVariables = {};
|
|
824
|
-
const outerVariables =
|
|
834
|
+
const outerVariables = getCoercedVariableValues(
|
|
835
|
+
delegationContext.info?.variableValues
|
|
836
|
+
);
|
|
825
837
|
for (const varName of usedVariables) {
|
|
826
838
|
const existingVar = originalRequest.variables?.[varName];
|
|
827
839
|
const outerVar = outerVariables?.[varName];
|
|
@@ -2341,7 +2353,8 @@ function createRequest({
|
|
|
2341
2353
|
`Either "targetFieldName" or a non empty "fieldNodes" array must be provided.`
|
|
2342
2354
|
);
|
|
2343
2355
|
}
|
|
2344
|
-
const
|
|
2356
|
+
const outerVariableValues = getCoercedVariableValues(info?.variableValues);
|
|
2357
|
+
const newVariables = outerVariableValues ? { ...outerVariableValues } : {};
|
|
2345
2358
|
const variableDefinitions = info?.operation.variableDefinitions ? [...info.operation.variableDefinitions] : [];
|
|
2346
2359
|
const argNodes = [];
|
|
2347
2360
|
const replacedVariableNames = /* @__PURE__ */ new Set();
|
|
@@ -2382,7 +2395,7 @@ function createRequest({
|
|
|
2382
2395
|
) || // It should not conflict with the variable on the gateway request
|
|
2383
2396
|
// Because the gateway request can have a variable that has nothing to do with
|
|
2384
2397
|
// this argument
|
|
2385
|
-
|
|
2398
|
+
outerVariableValues?.[varName2] != null;
|
|
2386
2399
|
let varName = argName;
|
|
2387
2400
|
if (varExists(varName)) {
|
|
2388
2401
|
varName = `_${rootFieldName}_${argName}`;
|
|
@@ -2572,9 +2585,9 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2572
2585
|
}
|
|
2573
2586
|
const deferred = createDeferredPromise();
|
|
2574
2587
|
missingDeferredFields.set(responseKey, deferred);
|
|
2575
|
-
const
|
|
2576
|
-
const
|
|
2577
|
-
const fieldNodesByType =
|
|
2588
|
+
const stitchingInfo2 = info.schema.extensions?.["stitchingInfo"];
|
|
2589
|
+
const parentTypeName2 = parent?.__typename || info.parentType.name;
|
|
2590
|
+
const fieldNodesByType = stitchingInfo2?.fieldNodesByField?.[parentTypeName2]?.[info.fieldName];
|
|
2578
2591
|
if (fieldNodesByType?.every((fieldNode) => {
|
|
2579
2592
|
const responseKey2 = fieldNode.alias?.value ?? fieldNode.name.value;
|
|
2580
2593
|
return Object.prototype.hasOwnProperty.call(parent, responseKey2);
|
|
@@ -2588,6 +2601,29 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2588
2601
|
if (Object.prototype.hasOwnProperty.call(parent, info.fieldName)) {
|
|
2589
2602
|
return defaultFieldResolver(parent, args, context, info);
|
|
2590
2603
|
}
|
|
2604
|
+
const stitchingInfo = info.schema?.extensions?.["stitchingInfo"];
|
|
2605
|
+
const parentTypeName = parent.__typename || info.parentType?.name;
|
|
2606
|
+
const mergedTypeInfo = parentTypeName ? stitchingInfo?.mergedTypes[parentTypeName] : void 0;
|
|
2607
|
+
const sourceSubschema = parent[OBJECT_SUBSCHEMA_SYMBOL];
|
|
2608
|
+
if (mergedTypeInfo && sourceSubschema) {
|
|
2609
|
+
const fieldNode = {
|
|
2610
|
+
kind: Kind.FIELD,
|
|
2611
|
+
name: info.fieldNodes[0]?.name ?? {
|
|
2612
|
+
kind: Kind.NAME,
|
|
2613
|
+
value: info.fieldName
|
|
2614
|
+
},
|
|
2615
|
+
selectionSet: {
|
|
2616
|
+
kind: Kind.SELECTION_SET,
|
|
2617
|
+
selections: info.fieldNodes
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
return handleMaybePromise(
|
|
2621
|
+
() => mergeFields(mergedTypeInfo, parent, sourceSubschema, context, info, [
|
|
2622
|
+
fieldNode
|
|
2623
|
+
]),
|
|
2624
|
+
() => Object.prototype.hasOwnProperty.call(parent, responseKey) ? handleResult(parent, responseKey, context, info) : void 0
|
|
2625
|
+
);
|
|
2626
|
+
}
|
|
2591
2627
|
return void 0;
|
|
2592
2628
|
}
|
|
2593
2629
|
return handleResult(parent, responseKey, context, info);
|
|
@@ -2717,10 +2753,13 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
2717
2753
|
responseKey
|
|
2718
2754
|
);
|
|
2719
2755
|
if (sourceSubschema && nestedTypeName) {
|
|
2756
|
+
const variableValues = getCoercedVariableValues(
|
|
2757
|
+
info.variableValues
|
|
2758
|
+
);
|
|
2720
2759
|
const delegationPlan = stitchingInfo.mergedTypes[nestedTypeName]?.delegationPlanBuilder(
|
|
2721
2760
|
info.schema,
|
|
2722
2761
|
sourceSubschema,
|
|
2723
|
-
|
|
2762
|
+
variableValues != null && Object.keys(variableValues).length > 0 ? variableValues : EMPTY_OBJECT,
|
|
2724
2763
|
info.fragments != null && Object.keys(info.fragments).length > 0 ? info.fragments : EMPTY_OBJECT,
|
|
2725
2764
|
getActualFieldNodes(fieldNode),
|
|
2726
2765
|
context,
|
|
@@ -3486,4 +3525,4 @@ function subtractSelectionSets(selectionSetA, selectionSetB, fragments = {}) {
|
|
|
3486
3525
|
};
|
|
3487
3526
|
}
|
|
3488
3527
|
|
|
3489
|
-
export {
|
|
3528
|
+
export { EMPTY_OBJECT, FIELD_SUBSCHEMA_MAP_SYMBOL, OBJECT_SUBSCHEMA_SYMBOL, PLAN_LEFT_OVER, Subschema, Transformer, UNPATHED_ERRORS_SYMBOL, annotateExternalObject, applySchemaTransforms, cloneSubschemaConfig, createRequest, defaultMergedResolver, delegateRequest, delegateToSchema, extractUnavailableFields, extractUnavailableFieldsFromSelectionSet, getActualFieldNodes, getDelegatingOperation, getPlanLeftOverFromParent, getSubschema, getTypeInfo, getTypeInfoWithType, getUnpathedErrors, handleOverrideByDelegation, handleResolverResult, isExternalObject, isPrototypePollutingKey, isSubschema, isSubschemaConfig, leftOverByDelegationPlan, mergeFields, resolveExternalValue, subtractSelectionSets };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/graphql-tools__delegate",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.3-depup.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A set of utils for faster development of GraphQL tools (with updated dependencies)",
|
|
6
6
|
"repository": {
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
},
|
|
84
84
|
"depsUpdated": 4,
|
|
85
85
|
"originalPackage": "@graphql-tools/delegate",
|
|
86
|
-
"originalVersion": "12.1.
|
|
87
|
-
"processedAt": "2026-
|
|
86
|
+
"originalVersion": "12.1.3",
|
|
87
|
+
"processedAt": "2026-09-03T16:09:50.247Z",
|
|
88
88
|
"smokeTest": "passed"
|
|
89
89
|
}
|
|
90
90
|
}
|