@graphql-tools/delegate 9.0.0-alpha-e309ae22.0 → 9.0.0-alpha-20220809152812-1a2a11ba
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/cjs/applySchemaTransforms.js +5 -4
- package/esm/applySchemaTransforms.js +5 -3
- package/package.json +6 -6
- package/typings/Subschema.d.cts +19 -0
- package/typings/Transformer.d.cts +10 -0
- package/typings/applySchemaTransforms.d.cts +3 -0
- package/typings/applySchemaTransforms.d.ts +1 -1
- package/typings/checkResultAndHandleErrors.d.cts +8 -0
- package/typings/createRequest.d.cts +5 -0
- package/typings/defaultMergedResolver.d.cts +9 -0
- package/typings/delegateToSchema.d.cts +6 -0
- package/typings/finalizeGatewayRequest.d.cts +3 -0
- package/typings/getDocumentMetadata.d.cts +6 -0
- package/typings/index.d.cts +10 -0
- package/typings/mergeFields.d.cts +8 -0
- package/typings/prepareGatewayDocument.d.cts +2 -0
- package/typings/resolveExternalValue.d.cts +3 -0
- package/typings/subschemaConfig.d.cts +3 -0
- package/typings/symbols.d.cts +3 -0
- package/typings/types.d.cts +135 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applySchemaTransforms = void 0;
|
|
4
|
-
|
|
4
|
+
const utils_1 = require("@graphql-tools/utils");
|
|
5
|
+
// TODO: Instead of memoization, we can make sure that this isn't called multiple times
|
|
6
|
+
exports.applySchemaTransforms = (0, utils_1.memoize2)(function applySchemaTransforms(originalWrappingSchema, subschemaConfig) {
|
|
5
7
|
const schemaTransforms = subschemaConfig.transforms;
|
|
6
8
|
if (schemaTransforms == null) {
|
|
7
9
|
return originalWrappingSchema;
|
|
8
10
|
}
|
|
9
|
-
return schemaTransforms.reduce((schema, transform) => transform.transformSchema
|
|
10
|
-
}
|
|
11
|
-
exports.applySchemaTransforms = applySchemaTransforms;
|
|
11
|
+
return schemaTransforms.reduce((schema, transform) => { var _a; return ((_a = transform.transformSchema) === null || _a === void 0 ? void 0 : _a.call(transform, schema, subschemaConfig)) || schema; }, originalWrappingSchema);
|
|
12
|
+
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { memoize2 } from '@graphql-tools/utils';
|
|
2
|
+
// TODO: Instead of memoization, we can make sure that this isn't called multiple times
|
|
3
|
+
export const applySchemaTransforms = memoize2(function applySchemaTransforms(originalWrappingSchema, subschemaConfig) {
|
|
2
4
|
const schemaTransforms = subschemaConfig.transforms;
|
|
3
5
|
if (schemaTransforms == null) {
|
|
4
6
|
return originalWrappingSchema;
|
|
5
7
|
}
|
|
6
|
-
return schemaTransforms.reduce((schema, transform) => transform.transformSchema
|
|
7
|
-
}
|
|
8
|
+
return schemaTransforms.reduce((schema, transform) => { var _a; return ((_a = transform.transformSchema) === null || _a === void 0 ? void 0 : _a.call(transform, schema, subschemaConfig)) || schema; }, originalWrappingSchema);
|
|
9
|
+
});
|
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-20220809152812-1a2a11ba",
|
|
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 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/batch-execute": "8.5.
|
|
11
|
-
"@graphql-tools/schema": "
|
|
12
|
-
"@graphql-tools/utils": "8.
|
|
10
|
+
"@graphql-tools/batch-execute": "8.5.2-alpha-20220809152812-1a2a11ba",
|
|
11
|
+
"@graphql-tools/schema": "9.0.0-alpha-20220809152812-1a2a11ba",
|
|
12
|
+
"@graphql-tools/utils": "8.9.1-alpha-20220809152812-1a2a11ba",
|
|
13
13
|
"dataloader": "2.1.0",
|
|
14
14
|
"tslib": "~2.4.0",
|
|
15
15
|
"value-or-promise": "1.0.11"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
32
|
"require": {
|
|
33
|
-
"types": "./typings/index.d.
|
|
33
|
+
"types": "./typings/index.d.cts",
|
|
34
34
|
"default": "./cjs/index.js"
|
|
35
35
|
},
|
|
36
36
|
"import": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"./*": {
|
|
46
46
|
"require": {
|
|
47
|
-
"types": "./typings/*.d.
|
|
47
|
+
"types": "./typings/*.d.cts",
|
|
48
48
|
"default": "./cjs/*.js"
|
|
49
49
|
},
|
|
50
50
|
"import": {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { SubschemaConfig, Transform, MergedTypeConfig, CreateProxyingResolverFn, BatchingOptions } from './types.cjs';
|
|
3
|
+
import { Executor } from '@graphql-tools/utils';
|
|
4
|
+
export declare function isSubschema(value: any): value is Subschema;
|
|
5
|
+
interface ISubschema<K = any, V = any, C = K, TContext = Record<string, any>> extends SubschemaConfig<K, V, C, TContext> {
|
|
6
|
+
transformedSchema: GraphQLSchema;
|
|
7
|
+
}
|
|
8
|
+
export declare class Subschema<K = any, V = any, C = K, TContext = Record<string, any>> implements ISubschema<K, V, C, TContext> {
|
|
9
|
+
schema: GraphQLSchema;
|
|
10
|
+
executor?: Executor<TContext>;
|
|
11
|
+
batch?: boolean;
|
|
12
|
+
batchingOptions?: BatchingOptions<K, V, C>;
|
|
13
|
+
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
|
|
14
|
+
transforms: Array<Transform<any, TContext>>;
|
|
15
|
+
transformedSchema: GraphQLSchema;
|
|
16
|
+
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
|
|
17
|
+
constructor(config: SubschemaConfig<K, V, C, TContext>);
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExecutionRequest, ExecutionResult } from '@graphql-tools/utils';
|
|
2
|
+
import { DelegationContext } from './types.cjs';
|
|
3
|
+
export declare class Transformer<TContext extends Record<string, any> = Record<string, any>> {
|
|
4
|
+
private transformations;
|
|
5
|
+
private delegationContext;
|
|
6
|
+
constructor(context: DelegationContext<TContext>);
|
|
7
|
+
private addTransform;
|
|
8
|
+
transformRequest(originalRequest: ExecutionRequest): ExecutionRequest;
|
|
9
|
+
transformResult(originalResult: ExecutionResult): any;
|
|
10
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
2
|
import { SubschemaConfig } from './types.js';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const applySchemaTransforms: (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, any>) => GraphQLSchema;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
2
|
+
import { ExecutionResult } from '@graphql-tools/utils';
|
|
3
|
+
import { DelegationContext } from './types.cjs';
|
|
4
|
+
export declare function checkResultAndHandleErrors<TContext extends Record<string, any>>(result: ExecutionResult, delegationContext: DelegationContext<TContext>): any;
|
|
5
|
+
export declare function mergeDataAndErrors(data: any, errors: ReadonlyArray<GraphQLError>, path: Array<string | number> | undefined, onLocatedError?: (originalError: GraphQLError) => GraphQLError, index?: number): {
|
|
6
|
+
data: any;
|
|
7
|
+
unpathedErrors: Array<GraphQLError>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GraphQLSchema, GraphQLObjectType, OperationTypeNode } from 'graphql';
|
|
2
|
+
import { ExecutionRequest } from '@graphql-tools/utils';
|
|
3
|
+
import { ICreateRequest } from './types.cjs';
|
|
4
|
+
export declare function getDelegatingOperation(parentType: GraphQLObjectType, schema: GraphQLSchema): OperationTypeNode;
|
|
5
|
+
export declare function createRequest({ sourceSchema, sourceParentType, sourceFieldName, fragments, variableDefinitions, variableValues, targetRootValue, targetOperationName, targetOperation, targetFieldName, selectionSet, fieldNodes, context, info, }: ICreateRequest): ExecutionRequest;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import { ExternalObject } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Resolver that knows how to:
|
|
5
|
+
* a) handle aliases for proxied schemas
|
|
6
|
+
* b) handle errors from proxied schemas
|
|
7
|
+
* c) handle external to internal enum conversion
|
|
8
|
+
*/
|
|
9
|
+
export declare function defaultMergedResolver(parent: ExternalObject, args: Record<string, any>, context: Record<string, any>, info: GraphQLResolveInfo): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { Executor } from '@graphql-tools/utils';
|
|
3
|
+
import { IDelegateToSchemaOptions, IDelegateRequestOptions } from './types.cjs';
|
|
4
|
+
export declare function delegateToSchema<TContext extends Record<string, any> = Record<string, any>, TArgs extends Record<string, any> = any>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
|
|
5
|
+
export declare function delegateRequest<TContext extends Record<string, any> = Record<string, any>, TArgs extends Record<string, any> = any>(options: IDelegateRequestOptions<TContext, TArgs>): any;
|
|
6
|
+
export declare const createDefaultExecutor: (schema: GraphQLSchema) => Executor;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocumentNode, FragmentDefinitionNode, OperationDefinitionNode } from 'graphql';
|
|
2
|
+
export declare function getDocumentMetadata(document: DocumentNode): {
|
|
3
|
+
operations: Array<OperationDefinitionNode>;
|
|
4
|
+
fragments: Array<FragmentDefinitionNode>;
|
|
5
|
+
fragmentNames: Set<string>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './Subschema.cjs';
|
|
2
|
+
export * from './Transformer.cjs';
|
|
3
|
+
export * from './applySchemaTransforms.cjs';
|
|
4
|
+
export * from './createRequest.cjs';
|
|
5
|
+
export * from './defaultMergedResolver.cjs';
|
|
6
|
+
export * from './delegateToSchema.cjs';
|
|
7
|
+
export * from './mergeFields.cjs';
|
|
8
|
+
export * from './resolveExternalValue.cjs';
|
|
9
|
+
export * from './subschemaConfig.cjs';
|
|
10
|
+
export * from './types.cjs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GraphQLResolveInfo, GraphQLError, GraphQLSchema } from 'graphql';
|
|
2
|
+
import { ExternalObject, MergedTypeInfo, SubschemaConfig } from './types.cjs';
|
|
3
|
+
import { Subschema } from './Subschema.cjs';
|
|
4
|
+
export declare function isExternalObject(data: any): data is ExternalObject;
|
|
5
|
+
export 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;
|
|
6
|
+
export declare function getSubschema(object: ExternalObject, responseKey: string): GraphQLSchema | SubschemaConfig;
|
|
7
|
+
export declare function getUnpathedErrors(object: ExternalObject): Array<GraphQLError>;
|
|
8
|
+
export declare function mergeFields<TContext>(mergedTypeInfo: MergedTypeInfo, object: any, sourceSubschema: Subschema<any, any, any, TContext>, context: any, info: GraphQLResolveInfo): Promise<any>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GraphQLResolveInfo, GraphQLError, GraphQLSchema, GraphQLOutputType } from 'graphql';
|
|
2
|
+
import { SubschemaConfig } from './types.cjs';
|
|
3
|
+
export 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;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { GraphQLSchema, GraphQLOutputType, SelectionSetNode, FieldNode, GraphQLResolveInfo, GraphQLFieldResolver, FragmentDefinitionNode, GraphQLObjectType, VariableDefinitionNode, OperationTypeNode, GraphQLError, GraphQLNamedType } from 'graphql';
|
|
2
|
+
import DataLoader from 'dataloader';
|
|
3
|
+
import { ExecutionRequest, ExecutionResult, Executor } from '@graphql-tools/utils';
|
|
4
|
+
import { Subschema } from './Subschema.cjs';
|
|
5
|
+
import { OBJECT_SUBSCHEMA_SYMBOL, FIELD_SUBSCHEMA_MAP_SYMBOL, UNPATHED_ERRORS_SYMBOL } from './symbols.cjs';
|
|
6
|
+
export declare type SchemaTransform<TContext = Record<any, string>> = (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, TContext>) => GraphQLSchema;
|
|
7
|
+
export declare type RequestTransform<T = Record<string, any>, TContext = Record<any, string>> = (originalRequest: ExecutionRequest, delegationContext: DelegationContext<TContext>, transformationContext: T) => ExecutionRequest;
|
|
8
|
+
export declare type ResultTransform<T = Record<string, any>, TContext = Record<any, string>> = (originalResult: ExecutionResult, delegationContext: DelegationContext<TContext>, transformationContext: T) => ExecutionResult;
|
|
9
|
+
export interface Transform<T = any, TContext = Record<string, any>> {
|
|
10
|
+
transformSchema?: SchemaTransform<TContext>;
|
|
11
|
+
transformRequest?: RequestTransform<T, TContext>;
|
|
12
|
+
transformResult?: ResultTransform<T, TContext>;
|
|
13
|
+
}
|
|
14
|
+
export interface DelegationContext<TContext = Record<string, any>> {
|
|
15
|
+
subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>;
|
|
16
|
+
subschemaConfig?: SubschemaConfig<any, any, any, TContext>;
|
|
17
|
+
targetSchema: GraphQLSchema;
|
|
18
|
+
operation: OperationTypeNode;
|
|
19
|
+
fieldName: string;
|
|
20
|
+
args?: Record<string, any>;
|
|
21
|
+
context?: TContext;
|
|
22
|
+
info?: GraphQLResolveInfo;
|
|
23
|
+
returnType: GraphQLOutputType;
|
|
24
|
+
onLocatedError?: (originalError: GraphQLError) => GraphQLError;
|
|
25
|
+
rootValue?: any;
|
|
26
|
+
transforms: Array<Transform<any, TContext>>;
|
|
27
|
+
transformedSchema: GraphQLSchema;
|
|
28
|
+
skipTypeMerging: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface IDelegateToSchemaOptions<TContext = Record<string, any>, TArgs = Record<string, any>> {
|
|
31
|
+
schema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>;
|
|
32
|
+
operationName?: string;
|
|
33
|
+
operation?: OperationTypeNode;
|
|
34
|
+
fieldName?: string;
|
|
35
|
+
returnType?: GraphQLOutputType;
|
|
36
|
+
onLocatedError?: (originalError: GraphQLError) => GraphQLError;
|
|
37
|
+
args?: TArgs;
|
|
38
|
+
selectionSet?: SelectionSetNode;
|
|
39
|
+
fieldNodes?: ReadonlyArray<FieldNode>;
|
|
40
|
+
context?: TContext;
|
|
41
|
+
info: GraphQLResolveInfo;
|
|
42
|
+
rootValue?: any;
|
|
43
|
+
transforms?: Array<Transform<any, TContext>>;
|
|
44
|
+
transformedSchema?: GraphQLSchema;
|
|
45
|
+
validateRequest?: boolean;
|
|
46
|
+
skipTypeMerging?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface IDelegateRequestOptions<TContext = Record<string, any>, TArgs = Record<string, any>> extends IDelegateToSchemaOptions<TContext, TArgs> {
|
|
49
|
+
request: ExecutionRequest;
|
|
50
|
+
}
|
|
51
|
+
export interface ICreateRequest {
|
|
52
|
+
sourceSchema?: GraphQLSchema;
|
|
53
|
+
sourceParentType?: GraphQLObjectType;
|
|
54
|
+
sourceFieldName?: string;
|
|
55
|
+
fragments?: Record<string, FragmentDefinitionNode>;
|
|
56
|
+
variableDefinitions?: ReadonlyArray<VariableDefinitionNode>;
|
|
57
|
+
variableValues?: Record<string, any>;
|
|
58
|
+
targetOperation: OperationTypeNode;
|
|
59
|
+
targetRootValue?: any;
|
|
60
|
+
targetOperationName?: string;
|
|
61
|
+
targetFieldName: string;
|
|
62
|
+
selectionSet?: SelectionSetNode;
|
|
63
|
+
fieldNodes?: ReadonlyArray<FieldNode>;
|
|
64
|
+
context?: any;
|
|
65
|
+
info?: GraphQLResolveInfo;
|
|
66
|
+
}
|
|
67
|
+
export declare type DelegationPlanBuilder = (schema: GraphQLSchema, sourceSubschema: Subschema<any, any, any, any>, variableValues: Record<string, any>, fragments: Record<string, FragmentDefinitionNode>, fieldNodes: FieldNode[]) => Array<Map<Subschema, SelectionSetNode>>;
|
|
68
|
+
export interface MergedTypeInfo<TContext = Record<string, any>> {
|
|
69
|
+
typeName: string;
|
|
70
|
+
selectionSet?: SelectionSetNode;
|
|
71
|
+
targetSubschemas: Map<Subschema<any, any, any, TContext>, Array<Subschema<any, any, any, TContext>>>;
|
|
72
|
+
uniqueFields: Record<string, Subschema<any, any, any, TContext>>;
|
|
73
|
+
nonUniqueFields: Record<string, Array<Subschema<any, any, any, TContext>>>;
|
|
74
|
+
typeMaps: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, Record<string, GraphQLNamedType>>;
|
|
75
|
+
selectionSets: Map<Subschema<any, any, any, TContext>, SelectionSetNode>;
|
|
76
|
+
fieldSelectionSets: Map<Subschema<any, any, any, TContext>, Record<string, SelectionSetNode>>;
|
|
77
|
+
resolvers: Map<Subschema<any, any, any, TContext>, MergedTypeResolver<TContext>>;
|
|
78
|
+
delegationPlanBuilder: DelegationPlanBuilder;
|
|
79
|
+
}
|
|
80
|
+
export interface ICreateProxyingResolverOptions<TContext = Record<string, any>> {
|
|
81
|
+
subschemaConfig: SubschemaConfig<any, any, any, TContext>;
|
|
82
|
+
operation?: OperationTypeNode;
|
|
83
|
+
fieldName?: string;
|
|
84
|
+
}
|
|
85
|
+
export declare type CreateProxyingResolverFn<TContext = Record<string, any>> = (options: ICreateProxyingResolverOptions<TContext>) => GraphQLFieldResolver<any, TContext>;
|
|
86
|
+
export interface BatchingOptions<K = any, V = any, C = K> {
|
|
87
|
+
extensionsReducer?: (mergedExtensions: Record<string, any>, request: ExecutionRequest) => Record<string, any>;
|
|
88
|
+
dataLoaderOptions?: DataLoader.Options<K, V, C>;
|
|
89
|
+
}
|
|
90
|
+
export interface SubschemaConfig<K = any, V = any, C = K, TContext = Record<string, any>> {
|
|
91
|
+
schema: GraphQLSchema;
|
|
92
|
+
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
|
|
93
|
+
rootValue?: any;
|
|
94
|
+
transforms?: Array<Transform<any, TContext>>;
|
|
95
|
+
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
|
|
96
|
+
executor?: Executor<TContext>;
|
|
97
|
+
batch?: boolean;
|
|
98
|
+
batchingOptions?: BatchingOptions<K, V, C>;
|
|
99
|
+
}
|
|
100
|
+
export interface MergedTypeConfig<K = any, V = any, TContext = Record<string, any>> extends MergedTypeEntryPoint<K, V, TContext> {
|
|
101
|
+
entryPoints?: Array<MergedTypeEntryPoint>;
|
|
102
|
+
fields?: Record<string, MergedFieldConfig>;
|
|
103
|
+
canonical?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface MergedTypeEntryPoint<K = any, V = any, TContext = Record<string, any>> extends MergedTypeResolverOptions<K, V> {
|
|
106
|
+
selectionSet?: string;
|
|
107
|
+
key?: (originalResult: any) => K | PromiseLike<K>;
|
|
108
|
+
resolve?: MergedTypeResolver<TContext>;
|
|
109
|
+
}
|
|
110
|
+
export interface MergedTypeResolverOptions<K = any, V = any> {
|
|
111
|
+
fieldName?: string;
|
|
112
|
+
args?: (originalResult: any) => Record<string, any>;
|
|
113
|
+
argsFromKeys?: (keys: ReadonlyArray<K>) => Record<string, any>;
|
|
114
|
+
valuesFromResults?: (results: any, keys: ReadonlyArray<K>) => Array<V>;
|
|
115
|
+
}
|
|
116
|
+
export interface MergedFieldConfig {
|
|
117
|
+
selectionSet?: string;
|
|
118
|
+
computed?: boolean;
|
|
119
|
+
canonical?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export declare type MergedTypeResolver<TContext = Record<string, any>> = (originalResult: any, context: TContext, info: GraphQLResolveInfo, subschema: Subschema<any, any, any, TContext>, selectionSet: SelectionSetNode, key: any | undefined, type: GraphQLOutputType) => any;
|
|
122
|
+
export interface StitchingInfo<TContext = Record<string, any>> {
|
|
123
|
+
subschemaMap: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, Subschema<any, any, any, TContext>>;
|
|
124
|
+
fieldNodesByType: Record<string, Array<FieldNode>>;
|
|
125
|
+
fieldNodesByField: Record<string, Record<string, Array<FieldNode>>>;
|
|
126
|
+
dynamicSelectionSetsByField: Record<string, Record<string, Array<(node: FieldNode) => SelectionSetNode>>>;
|
|
127
|
+
mergedTypes: Record<string, MergedTypeInfo<TContext>>;
|
|
128
|
+
}
|
|
129
|
+
export interface ExternalObject<TContext = Record<string, any>> {
|
|
130
|
+
__typename: string;
|
|
131
|
+
key: any;
|
|
132
|
+
[OBJECT_SUBSCHEMA_SYMBOL]: GraphQLSchema | SubschemaConfig<any, any, any, TContext>;
|
|
133
|
+
[FIELD_SUBSCHEMA_MAP_SYMBOL]: Record<string, GraphQLSchema | SubschemaConfig<any, any, any, TContext>>;
|
|
134
|
+
[UNPATHED_ERRORS_SYMBOL]: Array<GraphQLError>;
|
|
135
|
+
}
|