@depup/graphql-tools__delegate 12.1.2-depup.0 → 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 +28 -7
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +29 -7
- 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-09-
|
|
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
|
@@ -106,19 +106,18 @@ function getSubschema(object, responseKey) {
|
|
|
106
106
|
function getUnpathedErrors(object) {
|
|
107
107
|
return object[UNPATHED_ERRORS_SYMBOL];
|
|
108
108
|
}
|
|
109
|
-
const EMPTY_ARRAY = [];
|
|
110
109
|
const EMPTY_OBJECT = /* @__PURE__ */ Object.create(null);
|
|
111
110
|
const getActualFieldNodes = utils.memoize1(function(fieldNode) {
|
|
112
111
|
return [fieldNode];
|
|
113
112
|
});
|
|
114
|
-
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info) {
|
|
113
|
+
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info, fieldNodes = info.fieldNodes) {
|
|
115
114
|
const variableValues = getCoercedVariableValues(info.variableValues);
|
|
116
115
|
const delegationMaps = mergedTypeInfo.delegationPlanBuilder(
|
|
117
116
|
info.schema,
|
|
118
117
|
sourceSubschema,
|
|
119
118
|
variableValues != null && Object.keys(variableValues).length > 0 ? variableValues : EMPTY_OBJECT,
|
|
120
119
|
info.fragments != null && Object.keys(info.fragments).length > 0 ? info.fragments : EMPTY_OBJECT,
|
|
121
|
-
|
|
120
|
+
fieldNodes.length === 1 && fieldNodes[0] ? getActualFieldNodes(fieldNodes[0]) : fieldNodes,
|
|
122
121
|
context,
|
|
123
122
|
info
|
|
124
123
|
);
|
|
@@ -2586,9 +2585,9 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2586
2585
|
}
|
|
2587
2586
|
const deferred = promiseHelpers.createDeferredPromise();
|
|
2588
2587
|
missingDeferredFields.set(responseKey, deferred);
|
|
2589
|
-
const
|
|
2590
|
-
const
|
|
2591
|
-
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];
|
|
2592
2591
|
if (fieldNodesByType?.every((fieldNode) => {
|
|
2593
2592
|
const responseKey2 = fieldNode.alias?.value ?? fieldNode.name.value;
|
|
2594
2593
|
return Object.prototype.hasOwnProperty.call(parent, responseKey2);
|
|
@@ -2602,6 +2601,29 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2602
2601
|
if (Object.prototype.hasOwnProperty.call(parent, info.fieldName)) {
|
|
2603
2602
|
return graphql.defaultFieldResolver(parent, args, context, info);
|
|
2604
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
|
+
}
|
|
2605
2627
|
return void 0;
|
|
2606
2628
|
}
|
|
2607
2629
|
return handleResult(parent, responseKey, context, info);
|
|
@@ -3511,7 +3533,6 @@ Object.defineProperty(exports, "createDefaultExecutor", {
|
|
|
3511
3533
|
enumerable: true,
|
|
3512
3534
|
get: function () { return executor.executorFromSchema; }
|
|
3513
3535
|
});
|
|
3514
|
-
exports.EMPTY_ARRAY = EMPTY_ARRAY;
|
|
3515
3536
|
exports.EMPTY_OBJECT = EMPTY_OBJECT;
|
|
3516
3537
|
exports.FIELD_SUBSCHEMA_MAP_SYMBOL = FIELD_SUBSCHEMA_MAP_SYMBOL;
|
|
3517
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
|
@@ -106,19 +106,18 @@ function getSubschema(object, responseKey) {
|
|
|
106
106
|
function getUnpathedErrors(object) {
|
|
107
107
|
return object[UNPATHED_ERRORS_SYMBOL];
|
|
108
108
|
}
|
|
109
|
-
const EMPTY_ARRAY = [];
|
|
110
109
|
const EMPTY_OBJECT = /* @__PURE__ */ Object.create(null);
|
|
111
110
|
const getActualFieldNodes = memoize1(function(fieldNode) {
|
|
112
111
|
return [fieldNode];
|
|
113
112
|
});
|
|
114
|
-
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info) {
|
|
113
|
+
function mergeFields(mergedTypeInfo, object, sourceSubschema, context, info, fieldNodes = info.fieldNodes) {
|
|
115
114
|
const variableValues = getCoercedVariableValues(info.variableValues);
|
|
116
115
|
const delegationMaps = mergedTypeInfo.delegationPlanBuilder(
|
|
117
116
|
info.schema,
|
|
118
117
|
sourceSubschema,
|
|
119
118
|
variableValues != null && Object.keys(variableValues).length > 0 ? variableValues : EMPTY_OBJECT,
|
|
120
119
|
info.fragments != null && Object.keys(info.fragments).length > 0 ? info.fragments : EMPTY_OBJECT,
|
|
121
|
-
|
|
120
|
+
fieldNodes.length === 1 && fieldNodes[0] ? getActualFieldNodes(fieldNodes[0]) : fieldNodes,
|
|
122
121
|
context,
|
|
123
122
|
info
|
|
124
123
|
);
|
|
@@ -2586,9 +2585,9 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2586
2585
|
}
|
|
2587
2586
|
const deferred = createDeferredPromise();
|
|
2588
2587
|
missingDeferredFields.set(responseKey, deferred);
|
|
2589
|
-
const
|
|
2590
|
-
const
|
|
2591
|
-
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];
|
|
2592
2591
|
if (fieldNodesByType?.every((fieldNode) => {
|
|
2593
2592
|
const responseKey2 = fieldNode.alias?.value ?? fieldNode.name.value;
|
|
2594
2593
|
return Object.prototype.hasOwnProperty.call(parent, responseKey2);
|
|
@@ -2602,6 +2601,29 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
2602
2601
|
if (Object.prototype.hasOwnProperty.call(parent, info.fieldName)) {
|
|
2603
2602
|
return defaultFieldResolver(parent, args, context, info);
|
|
2604
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
|
+
}
|
|
2605
2627
|
return void 0;
|
|
2606
2628
|
}
|
|
2607
2629
|
return handleResult(parent, responseKey, context, info);
|
|
@@ -3503,4 +3525,4 @@ function subtractSelectionSets(selectionSetA, selectionSetB, fragments = {}) {
|
|
|
3503
3525
|
};
|
|
3504
3526
|
}
|
|
3505
3527
|
|
|
3506
|
-
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-09-
|
|
86
|
+
"originalVersion": "12.1.3",
|
|
87
|
+
"processedAt": "2026-09-03T16:09:50.247Z",
|
|
88
88
|
"smokeTest": "passed"
|
|
89
89
|
}
|
|
90
90
|
}
|