/
types.ts
62 lines (55 loc) · 1.88 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import {
GraphQLSchema,
GraphQLFieldResolver,
BuildSchemaOptions,
GraphQLInputFieldConfig,
GraphQLFieldConfig,
FieldNode,
FragmentDefinitionNode,
SelectionNode,
ObjectFieldNode,
ObjectValueNode,
} from 'graphql';
import { Executor, Subscriber, DelegationContext } from '@graphql-tools/delegate';
import { Request } from '@graphql-tools/utils';
export interface IMakeRemoteExecutableSchemaOptions {
schema: GraphQLSchema | string;
executor?: Executor;
subscriber?: Subscriber;
createResolver?: (executor: Executor, subscriber: Subscriber) => GraphQLFieldResolver<any, any>;
buildSchemaOptions?: BuildSchemaOptions;
}
export type InputFieldTransformer = (
typeName: string,
fieldName: string,
inputFieldConfig: GraphQLInputFieldConfig
) => GraphQLInputFieldConfig | [string, GraphQLInputFieldConfig] | null | undefined;
export type InputFieldNodeTransformer = (
typeName: string,
fieldName: string,
inputFieldNode: ObjectFieldNode,
delegationContext: DelegationContext,
request: Request
) => ObjectFieldNode | Array<ObjectFieldNode>;
export type InputObjectNodeTransformer = (
typeName: string,
inputObjectNode: ObjectValueNode,
delegationContext: DelegationContext,
request: Request
) => ObjectValueNode;
export type FieldTransformer = (
typeName: string,
fieldName: string,
fieldConfig: GraphQLFieldConfig<any, any>
) => GraphQLFieldConfig<any, any> | [string, GraphQLFieldConfig<any, any>] | null | undefined;
export type RootFieldTransformer = (
operation: 'Query' | 'Mutation' | 'Subscription',
fieldName: string,
fieldConfig: GraphQLFieldConfig<any, any>
) => GraphQLFieldConfig<any, any> | [string, GraphQLFieldConfig<any, any>] | null | undefined;
export type FieldNodeTransformer = (
typeName: string,
fieldName: string,
fieldNode: FieldNode,
fragments: Record<string, FragmentDefinitionNode>
) => SelectionNode | Array<SelectionNode>;