@graphql-tools/delegate 8.2.2-alpha-f3a085b1.0 → 8.2.2
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/package.json +4 -4
- package/es5/README.md +0 -7
- package/es5/Subschema.d.ts +0 -19
- package/es5/Transformer.d.ts +0 -10
- package/es5/applySchemaTransforms.d.ts +0 -3
- package/es5/checkResultAndHandleErrors.d.ts +0 -8
- package/es5/createRequest.d.ts +0 -6
- package/es5/defaultMergedResolver.d.ts +0 -9
- package/es5/delegateToSchema.d.ts +0 -6
- package/es5/finalizeGatewayRequest.d.ts +0 -3
- package/es5/getDocumentMetadata.d.ts +0 -6
- package/es5/index.d.ts +0 -10
- package/es5/index.js +0 -1694
- package/es5/index.mjs +0 -1672
- package/es5/mergeFields.d.ts +0 -8
- package/es5/package.json +0 -39
- package/es5/prepareGatewayDocument.d.ts +0 -2
- package/es5/resolveExternalValue.d.ts +0 -3
- package/es5/subschemaConfig.d.ts +0 -3
- package/es5/symbols.d.ts +0 -3
- package/es5/types.d.ts +0 -149
package/es5/mergeFields.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GraphQLResolveInfo, GraphQLError, GraphQLSchema } from 'graphql';
|
|
2
|
-
import { ExternalObject, MergedTypeInfo, SubschemaConfig } from './types';
|
|
3
|
-
import { Subschema } from './Subschema';
|
|
4
|
-
export declare function isExternalObject(data: any): data is ExternalObject;
|
|
5
|
-
export declare function annotateExternalObject(object: any, errors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig | 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(mergedTypeInfo: MergedTypeInfo, object: any, sourceSubschema: Subschema<any, any, any, any>, context: any, info: GraphQLResolveInfo): Promise<any>;
|
package/es5/package.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@graphql-tools/delegate/es5",
|
|
3
|
-
"version": "8.2.2-alpha-f3a085b1.0",
|
|
4
|
-
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
|
-
"sideEffects": false,
|
|
6
|
-
"peerDependencies": {
|
|
7
|
-
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@graphql-tools/batch-execute": "^8.1.0",
|
|
11
|
-
"@graphql-tools/schema": "8.2.1-alpha-f3a085b1.0",
|
|
12
|
-
"@graphql-tools/utils": "^8.2.0",
|
|
13
|
-
"dataloader": "2.0.0",
|
|
14
|
-
"tslib": "~2.3.0",
|
|
15
|
-
"value-or-promise": "1.0.10"
|
|
16
|
-
},
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "ardatan/graphql-tools",
|
|
20
|
-
"directory": "packages/delegate"
|
|
21
|
-
},
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"main": "index.js",
|
|
24
|
-
"module": "index.mjs",
|
|
25
|
-
"typings": "index.d.ts",
|
|
26
|
-
"typescript": {
|
|
27
|
-
"definition": "index.d.ts"
|
|
28
|
-
},
|
|
29
|
-
"exports": {
|
|
30
|
-
".": {
|
|
31
|
-
"require": "./index.js",
|
|
32
|
-
"import": "./index.mjs"
|
|
33
|
-
},
|
|
34
|
-
"./*": {
|
|
35
|
-
"require": "./*.js",
|
|
36
|
-
"import": "./*.mjs"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { GraphQLResolveInfo, GraphQLError, GraphQLSchema, GraphQLOutputType } from 'graphql';
|
|
2
|
-
import { SubschemaConfig } from './types';
|
|
3
|
-
export declare function resolveExternalValue(result: any, unpathedErrors: Array<GraphQLError>, subschema: GraphQLSchema | SubschemaConfig, context?: Record<string, any>, info?: GraphQLResolveInfo, returnType?: GraphQLOutputType, skipTypeMerging?: boolean): any;
|
package/es5/subschemaConfig.d.ts
DELETED
package/es5/symbols.d.ts
DELETED
package/es5/types.d.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
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';
|
|
5
|
-
import { OBJECT_SUBSCHEMA_SYMBOL, FIELD_SUBSCHEMA_MAP_SYMBOL, UNPATHED_ERRORS_SYMBOL } from './symbols';
|
|
6
|
-
export declare type SchemaTransform<TContext = Record<any, string>> = (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, TContext>, transformedSchema?: GraphQLSchema) => GraphQLSchema;
|
|
7
|
-
export declare type RequestTransform<T = Record<string, any>> = (originalRequest: ExecutionRequest, delegationContext: DelegationContext, transformationContext: T) => ExecutionRequest;
|
|
8
|
-
export declare type ResultTransform<T = Record<string, any>> = (originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: T) => ExecutionResult;
|
|
9
|
-
export interface Transform<T = any, TContext = Record<string, any>> {
|
|
10
|
-
transformSchema?: SchemaTransform<TContext>;
|
|
11
|
-
transformRequest?: RequestTransform<T>;
|
|
12
|
-
transformResult?: ResultTransform<T>;
|
|
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 ICreateRequestFromInfo {
|
|
52
|
-
info: GraphQLResolveInfo;
|
|
53
|
-
rootValue?: any;
|
|
54
|
-
operationName?: string;
|
|
55
|
-
operation?: OperationTypeNode;
|
|
56
|
-
fieldName?: string;
|
|
57
|
-
selectionSet?: SelectionSetNode;
|
|
58
|
-
fieldNodes?: ReadonlyArray<FieldNode>;
|
|
59
|
-
context?: any;
|
|
60
|
-
}
|
|
61
|
-
export interface ICreateRequest {
|
|
62
|
-
sourceSchema?: GraphQLSchema;
|
|
63
|
-
sourceParentType?: GraphQLObjectType;
|
|
64
|
-
sourceFieldName?: string;
|
|
65
|
-
fragments?: Record<string, FragmentDefinitionNode>;
|
|
66
|
-
variableDefinitions?: ReadonlyArray<VariableDefinitionNode>;
|
|
67
|
-
variableValues?: Record<string, any>;
|
|
68
|
-
targetOperation: OperationTypeNode;
|
|
69
|
-
targetRootValue?: any;
|
|
70
|
-
targetOperationName?: string;
|
|
71
|
-
targetFieldName: string;
|
|
72
|
-
selectionSet?: SelectionSetNode;
|
|
73
|
-
fieldNodes?: ReadonlyArray<FieldNode>;
|
|
74
|
-
context?: any;
|
|
75
|
-
info?: GraphQLResolveInfo;
|
|
76
|
-
}
|
|
77
|
-
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>>;
|
|
78
|
-
export interface MergedTypeInfo<TContext = Record<string, any>> {
|
|
79
|
-
typeName: string;
|
|
80
|
-
selectionSet?: SelectionSetNode;
|
|
81
|
-
targetSubschemas: Map<Subschema<any, any, any, TContext>, Array<Subschema<any, any, any, TContext>>>;
|
|
82
|
-
uniqueFields: Record<string, Subschema<any, any, any, TContext>>;
|
|
83
|
-
nonUniqueFields: Record<string, Array<Subschema<any, any, any, TContext>>>;
|
|
84
|
-
typeMaps: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, Record<string, GraphQLNamedType>>;
|
|
85
|
-
selectionSets: Map<Subschema<any, any, any, TContext>, SelectionSetNode>;
|
|
86
|
-
fieldSelectionSets: Map<Subschema<any, any, any, TContext>, Record<string, SelectionSetNode>>;
|
|
87
|
-
resolvers: Map<Subschema<any, any, any, TContext>, MergedTypeResolver<TContext>>;
|
|
88
|
-
delegationPlanBuilder: DelegationPlanBuilder;
|
|
89
|
-
}
|
|
90
|
-
export interface ICreateProxyingResolverOptions<TContext = Record<string, any>> {
|
|
91
|
-
subschemaConfig: SubschemaConfig<any, any, any, TContext>;
|
|
92
|
-
transformedSchema?: GraphQLSchema;
|
|
93
|
-
operation?: OperationTypeNode;
|
|
94
|
-
fieldName?: string;
|
|
95
|
-
}
|
|
96
|
-
export declare type CreateProxyingResolverFn<TContext = Record<string, any>> = (options: ICreateProxyingResolverOptions<TContext>) => GraphQLFieldResolver<any, TContext>;
|
|
97
|
-
export interface BatchingOptions<K = any, V = any, C = K> {
|
|
98
|
-
extensionsReducer?: (mergedExtensions: Record<string, any>, request: ExecutionRequest) => Record<string, any>;
|
|
99
|
-
dataLoaderOptions?: DataLoader.Options<K, V, C>;
|
|
100
|
-
}
|
|
101
|
-
export interface SubschemaConfig<K = any, V = any, C = K, TContext = Record<string, any>> {
|
|
102
|
-
schema: GraphQLSchema;
|
|
103
|
-
createProxyingResolver?: CreateProxyingResolverFn<TContext>;
|
|
104
|
-
rootValue?: any;
|
|
105
|
-
transforms?: Array<Transform<any, TContext>>;
|
|
106
|
-
merge?: Record<string, MergedTypeConfig<any, any, TContext>>;
|
|
107
|
-
executor?: Executor<TContext>;
|
|
108
|
-
batch?: boolean;
|
|
109
|
-
batchingOptions?: BatchingOptions<K, V, C>;
|
|
110
|
-
}
|
|
111
|
-
export interface MergedTypeConfig<K = any, V = any, TContext = Record<string, any>> extends MergedTypeEntryPoint<K, V, TContext> {
|
|
112
|
-
entryPoints?: Array<MergedTypeEntryPoint>;
|
|
113
|
-
fields?: Record<string, MergedFieldConfig>;
|
|
114
|
-
computedFields?: Record<string, {
|
|
115
|
-
selectionSet?: string;
|
|
116
|
-
}>;
|
|
117
|
-
canonical?: boolean;
|
|
118
|
-
}
|
|
119
|
-
export interface MergedTypeEntryPoint<K = any, V = any, TContext = Record<string, any>> extends MergedTypeResolverOptions<K, V> {
|
|
120
|
-
selectionSet?: string;
|
|
121
|
-
key?: (originalResult: any) => K;
|
|
122
|
-
resolve?: MergedTypeResolver<TContext>;
|
|
123
|
-
}
|
|
124
|
-
export interface MergedTypeResolverOptions<K = any, V = any> {
|
|
125
|
-
fieldName?: string;
|
|
126
|
-
args?: (originalResult: any) => Record<string, any>;
|
|
127
|
-
argsFromKeys?: (keys: ReadonlyArray<K>) => Record<string, any>;
|
|
128
|
-
valuesFromResults?: (results: any, keys: ReadonlyArray<K>) => Array<V>;
|
|
129
|
-
}
|
|
130
|
-
export interface MergedFieldConfig {
|
|
131
|
-
selectionSet?: string;
|
|
132
|
-
computed?: boolean;
|
|
133
|
-
canonical?: boolean;
|
|
134
|
-
}
|
|
135
|
-
export declare type MergedTypeResolver<TContext = Record<string, any>> = (originalResult: any, context: TContext, info: GraphQLResolveInfo, subschema: GraphQLSchema | SubschemaConfig<any, any, any, TContext>, selectionSet: SelectionSetNode, key?: any) => any;
|
|
136
|
-
export interface StitchingInfo<TContext = Record<string, any>> {
|
|
137
|
-
subschemaMap: Map<GraphQLSchema | SubschemaConfig<any, any, any, TContext>, Subschema<any, any, any, TContext>>;
|
|
138
|
-
fieldNodesByType: Record<string, Array<FieldNode>>;
|
|
139
|
-
fieldNodesByField: Record<string, Record<string, Array<FieldNode>>>;
|
|
140
|
-
dynamicSelectionSetsByField: Record<string, Record<string, Array<(node: FieldNode) => SelectionSetNode>>>;
|
|
141
|
-
mergedTypes: Record<string, MergedTypeInfo<TContext>>;
|
|
142
|
-
}
|
|
143
|
-
export interface ExternalObject<TContext = Record<string, any>> {
|
|
144
|
-
__typename: string;
|
|
145
|
-
key: any;
|
|
146
|
-
[OBJECT_SUBSCHEMA_SYMBOL]: GraphQLSchema | SubschemaConfig<any, any, any, TContext>;
|
|
147
|
-
[FIELD_SUBSCHEMA_MAP_SYMBOL]: Record<string, GraphQLSchema | SubschemaConfig<any, any, any, TContext>>;
|
|
148
|
-
[UNPATHED_ERRORS_SYMBOL]: Array<GraphQLError>;
|
|
149
|
-
}
|