@graphql-tools/delegate 10.2.7 → 10.2.8-alpha-51951b016e1cd61439beba8337a1d02d98f72fd8
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/CHANGELOG.md +8 -0
- package/dist/index.cjs +8 -17
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -15
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @graphql-tools/delegate
|
|
2
2
|
|
|
3
|
+
## 10.2.8-alpha-51951b016e1cd61439beba8337a1d02d98f72fd8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#322](https://github.com/graphql-hive/gateway/pull/322) [`51951b0`](https://github.com/graphql-hive/gateway/commit/51951b016e1cd61439beba8337a1d02d98f72fd8) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates:
|
|
8
|
+
|
|
9
|
+
- Updated dependency [`@graphql-tools/executor@^1.3.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/executor/v/1.3.8) (from `^1.3.6`, in `dependencies`)
|
|
10
|
+
|
|
3
11
|
## 10.2.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2441,30 +2441,18 @@ function validateRequest(delegationContext, document) {
|
|
|
2441
2441
|
const GLOBAL_CONTEXT = {};
|
|
2442
2442
|
function getExecutor(delegationContext) {
|
|
2443
2443
|
const { subschemaConfig, targetSchema, context } = delegationContext;
|
|
2444
|
-
let executor = subschemaConfig?.executor ||
|
|
2444
|
+
let executor$1 = subschemaConfig?.executor || executor.executorFromSchema(targetSchema);
|
|
2445
2445
|
if (subschemaConfig?.batch) {
|
|
2446
2446
|
const batchingOptions = subschemaConfig?.batchingOptions;
|
|
2447
|
-
executor = batchExecute.getBatchingExecutor(
|
|
2447
|
+
executor$1 = batchExecute.getBatchingExecutor(
|
|
2448
2448
|
context ?? GLOBAL_CONTEXT,
|
|
2449
|
-
executor,
|
|
2449
|
+
executor$1,
|
|
2450
2450
|
batchingOptions?.dataLoaderOptions,
|
|
2451
2451
|
batchingOptions?.extensionsReducer
|
|
2452
2452
|
);
|
|
2453
2453
|
}
|
|
2454
|
-
return executor;
|
|
2454
|
+
return executor$1;
|
|
2455
2455
|
}
|
|
2456
|
-
const createDefaultExecutor = utils.memoize1(function createDefaultExecutor2(schema) {
|
|
2457
|
-
return function defaultExecutor(request) {
|
|
2458
|
-
return executor.normalizedExecutor({
|
|
2459
|
-
schema,
|
|
2460
|
-
document: request.document,
|
|
2461
|
-
rootValue: request.rootValue,
|
|
2462
|
-
contextValue: request.context,
|
|
2463
|
-
variableValues: request.variables,
|
|
2464
|
-
operationName: request.operationName
|
|
2465
|
-
});
|
|
2466
|
-
};
|
|
2467
|
-
});
|
|
2468
2456
|
|
|
2469
2457
|
function extractUnavailableFieldsFromSelectionSet(schema, fieldType, fieldSelectionSet, shouldAdd, fragments = {}) {
|
|
2470
2458
|
if (graphql.isLeafType(fieldType)) {
|
|
@@ -2669,6 +2657,10 @@ Object.defineProperty(exports, "createDeferred", {
|
|
|
2669
2657
|
enumerable: true,
|
|
2670
2658
|
get: function () { return utils.createDeferred; }
|
|
2671
2659
|
});
|
|
2660
|
+
Object.defineProperty(exports, "createDefaultExecutor", {
|
|
2661
|
+
enumerable: true,
|
|
2662
|
+
get: function () { return executor.executorFromSchema; }
|
|
2663
|
+
});
|
|
2672
2664
|
exports.EMPTY_ARRAY = EMPTY_ARRAY;
|
|
2673
2665
|
exports.EMPTY_OBJECT = EMPTY_OBJECT;
|
|
2674
2666
|
exports.FIELD_SUBSCHEMA_MAP_SYMBOL = FIELD_SUBSCHEMA_MAP_SYMBOL;
|
|
@@ -2680,7 +2672,6 @@ exports.UNPATHED_ERRORS_SYMBOL = UNPATHED_ERRORS_SYMBOL;
|
|
|
2680
2672
|
exports.annotateExternalObject = annotateExternalObject;
|
|
2681
2673
|
exports.applySchemaTransforms = applySchemaTransforms;
|
|
2682
2674
|
exports.cloneSubschemaConfig = cloneSubschemaConfig;
|
|
2683
|
-
exports.createDefaultExecutor = createDefaultExecutor;
|
|
2684
2675
|
exports.createRequest = createRequest;
|
|
2685
2676
|
exports.defaultMergedResolver = defaultMergedResolver;
|
|
2686
2677
|
exports.delegateRequest = delegateRequest;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ export { createDeferred } from '@graphql-tools/utils';
|
|
|
3
3
|
import * as graphql from 'graphql';
|
|
4
4
|
import { GraphQLSchema, OperationTypeNode, GraphQLResolveInfo, GraphQLOutputType, GraphQLError, SelectionSetNode, FieldNode, GraphQLObjectType, FragmentDefinitionNode, VariableDefinitionNode, GraphQLNamedType, GraphQLFieldResolver, GraphQLNamedOutputType, GraphQLInterfaceType, SelectionNode, GraphQLField, TypeInfo, GraphQLType } from 'graphql';
|
|
5
5
|
import DataLoader from 'dataloader';
|
|
6
|
+
export { executorFromSchema as createDefaultExecutor } from '@graphql-tools/executor';
|
|
6
7
|
|
|
7
8
|
declare const UNPATHED_ERRORS_SYMBOL: unique symbol;
|
|
8
9
|
declare const OBJECT_SUBSCHEMA_SYMBOL: unique symbol;
|
|
@@ -189,7 +190,6 @@ declare function defaultMergedResolver(parent: ExternalObject, args: Record<stri
|
|
|
189
190
|
|
|
190
191
|
declare function delegateToSchema<TContext extends Record<string, any> = Record<string, any>, TArgs extends Record<string, any> = any>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
|
|
191
192
|
declare function delegateRequest<TContext extends Record<string, any> = Record<string, any>, TArgs extends Record<string, any> = any>(options: IDelegateRequestOptions<TContext, TArgs>): any;
|
|
192
|
-
declare const createDefaultExecutor: (schema: GraphQLSchema) => Executor;
|
|
193
193
|
|
|
194
194
|
declare function isExternalObject(data: any): data is ExternalObject;
|
|
195
195
|
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;
|
|
@@ -225,4 +225,4 @@ declare function getPlanLeftOverFromParent(parent: any): DelegationPlanLeftOver
|
|
|
225
225
|
declare const getTypeInfo: (schema: GraphQLSchema) => TypeInfo;
|
|
226
226
|
declare const getTypeInfoWithType: (schema: GraphQLSchema, type: Maybe<GraphQLType>) => TypeInfo;
|
|
227
227
|
|
|
228
|
-
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver, EMPTY_ARRAY, 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, PLAN_LEFT_OVER, type RequestTransform, type ResultTransform, type SchemaTransform, type StitchingInfo, Subschema, type SubschemaConfig, type Transform, Transformer, UNPATHED_ERRORS_SYMBOL, annotateExternalObject, applySchemaTransforms, cloneSubschemaConfig,
|
|
228
|
+
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver, EMPTY_ARRAY, 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, 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, handleResolverResult, isExternalObject, isSubschema, isSubschemaConfig, leftOverByDelegationPlan, mergeFields, resolveExternalValue, subtractSelectionSets };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { createDeferred } from '@graphql-tools/utils';
|
|
|
3
3
|
import * as graphql from 'graphql';
|
|
4
4
|
import { GraphQLSchema, OperationTypeNode, GraphQLResolveInfo, GraphQLOutputType, GraphQLError, SelectionSetNode, FieldNode, GraphQLObjectType, FragmentDefinitionNode, VariableDefinitionNode, GraphQLNamedType, GraphQLFieldResolver, GraphQLNamedOutputType, GraphQLInterfaceType, SelectionNode, GraphQLField, TypeInfo, GraphQLType } from 'graphql';
|
|
5
5
|
import DataLoader from 'dataloader';
|
|
6
|
+
export { executorFromSchema as createDefaultExecutor } from '@graphql-tools/executor';
|
|
6
7
|
|
|
7
8
|
declare const UNPATHED_ERRORS_SYMBOL: unique symbol;
|
|
8
9
|
declare const OBJECT_SUBSCHEMA_SYMBOL: unique symbol;
|
|
@@ -189,7 +190,6 @@ declare function defaultMergedResolver(parent: ExternalObject, args: Record<stri
|
|
|
189
190
|
|
|
190
191
|
declare function delegateToSchema<TContext extends Record<string, any> = Record<string, any>, TArgs extends Record<string, any> = any>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
|
|
191
192
|
declare function delegateRequest<TContext extends Record<string, any> = Record<string, any>, TArgs extends Record<string, any> = any>(options: IDelegateRequestOptions<TContext, TArgs>): any;
|
|
192
|
-
declare const createDefaultExecutor: (schema: GraphQLSchema) => Executor;
|
|
193
193
|
|
|
194
194
|
declare function isExternalObject(data: any): data is ExternalObject;
|
|
195
195
|
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;
|
|
@@ -225,4 +225,4 @@ declare function getPlanLeftOverFromParent(parent: any): DelegationPlanLeftOver
|
|
|
225
225
|
declare const getTypeInfo: (schema: GraphQLSchema) => TypeInfo;
|
|
226
226
|
declare const getTypeInfoWithType: (schema: GraphQLSchema, type: Maybe<GraphQLType>) => TypeInfo;
|
|
227
227
|
|
|
228
|
-
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver, EMPTY_ARRAY, 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, PLAN_LEFT_OVER, type RequestTransform, type ResultTransform, type SchemaTransform, type StitchingInfo, Subschema, type SubschemaConfig, type Transform, Transformer, UNPATHED_ERRORS_SYMBOL, annotateExternalObject, applySchemaTransforms, cloneSubschemaConfig,
|
|
228
|
+
export { type BatchingOptions, type CreateProxyingResolverFn, type Deferred, type DelegationContext, type DelegationPlanBuilder, type DelegationPlanLeftOver, EMPTY_ARRAY, 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, 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, handleResolverResult, isExternalObject, isSubschema, isSubschemaConfig, leftOverByDelegationPlan, mergeFields, resolveExternalValue, subtractSelectionSets };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { memoize2, memoize1, mapMaybePromise, collectFields, relocatedError, mergeDeep, pathToArray, isPromise, getResponseKeyFromInfo, getDefinedRootType, createVariableNameGenerator, updateArgument, serializeInputValue, createGraphQLError, implementsAbstractType, getRootTypeNames, createDeferred, isAsyncIterable, mapAsyncIterator, getOperationASTFromRequest } from '@graphql-tools/utils';
|
|
2
2
|
export { createDeferred } from '@graphql-tools/utils';
|
|
3
3
|
import { GraphQLError, locatedError, isAbstractType, getNullableType, isLeafType, isCompositeType, isListType, responsePathAsArray, Kind, TypeInfo, versionInfo, visit, visitWithTypeInfo, isObjectType, isInterfaceType, isUnionType, getNamedType, isNullableType, typeFromAST, defaultFieldResolver, validate } from 'graphql';
|
|
4
|
-
import { CRITICAL_ERROR,
|
|
4
|
+
import { CRITICAL_ERROR, executorFromSchema } from '@graphql-tools/executor';
|
|
5
|
+
export { executorFromSchema as createDefaultExecutor } from '@graphql-tools/executor';
|
|
5
6
|
import { getBatchingExecutor } from '@graphql-tools/batch-execute';
|
|
6
7
|
import { Repeater } from '@repeaterjs/repeater';
|
|
7
8
|
import { dset } from 'dset/merge';
|
|
@@ -2440,7 +2441,7 @@ function validateRequest(delegationContext, document) {
|
|
|
2440
2441
|
const GLOBAL_CONTEXT = {};
|
|
2441
2442
|
function getExecutor(delegationContext) {
|
|
2442
2443
|
const { subschemaConfig, targetSchema, context } = delegationContext;
|
|
2443
|
-
let executor = subschemaConfig?.executor ||
|
|
2444
|
+
let executor = subschemaConfig?.executor || executorFromSchema(targetSchema);
|
|
2444
2445
|
if (subschemaConfig?.batch) {
|
|
2445
2446
|
const batchingOptions = subschemaConfig?.batchingOptions;
|
|
2446
2447
|
executor = getBatchingExecutor(
|
|
@@ -2452,18 +2453,6 @@ function getExecutor(delegationContext) {
|
|
|
2452
2453
|
}
|
|
2453
2454
|
return executor;
|
|
2454
2455
|
}
|
|
2455
|
-
const createDefaultExecutor = memoize1(function createDefaultExecutor2(schema) {
|
|
2456
|
-
return function defaultExecutor(request) {
|
|
2457
|
-
return normalizedExecutor({
|
|
2458
|
-
schema,
|
|
2459
|
-
document: request.document,
|
|
2460
|
-
rootValue: request.rootValue,
|
|
2461
|
-
contextValue: request.context,
|
|
2462
|
-
variableValues: request.variables,
|
|
2463
|
-
operationName: request.operationName
|
|
2464
|
-
});
|
|
2465
|
-
};
|
|
2466
|
-
});
|
|
2467
2456
|
|
|
2468
2457
|
function extractUnavailableFieldsFromSelectionSet(schema, fieldType, fieldSelectionSet, shouldAdd, fragments = {}) {
|
|
2469
2458
|
if (isLeafType(fieldType)) {
|
|
@@ -2664,4 +2653,4 @@ function subtractSelectionSets(selectionSetA, selectionSetB) {
|
|
|
2664
2653
|
});
|
|
2665
2654
|
}
|
|
2666
2655
|
|
|
2667
|
-
export { EMPTY_ARRAY, EMPTY_OBJECT, FIELD_SUBSCHEMA_MAP_SYMBOL, OBJECT_SUBSCHEMA_SYMBOL, PLAN_LEFT_OVER, Subschema, Transformer, UNPATHED_ERRORS_SYMBOL, annotateExternalObject, applySchemaTransforms, cloneSubschemaConfig,
|
|
2656
|
+
export { EMPTY_ARRAY, 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, handleResolverResult, isExternalObject, isSubschema, isSubschemaConfig, leftOverByDelegationPlan, mergeFields, resolveExternalValue, subtractSelectionSets };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/delegate",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.8-alpha-51951b016e1cd61439beba8337a1d02d98f72fd8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@graphql-tools/batch-execute": "^9.0.10",
|
|
42
|
-
"@graphql-tools/executor": "^1.3.
|
|
42
|
+
"@graphql-tools/executor": "^1.3.8",
|
|
43
43
|
"@graphql-tools/schema": "^10.0.11",
|
|
44
44
|
"@graphql-tools/utils": "^10.6.2",
|
|
45
45
|
"@repeaterjs/repeater": "^3.0.6",
|