UNPKG

1.26 kBTypeScriptView Raw
1import { DocumentNode, FieldNode } from 'graphql';
2import { FragmentMap, DirectiveInfo } from 'apollo-utilities';
3export declare type Resolver = (fieldName: string, rootValue: any, args: any, context: any, info: ExecInfo) => any;
4export declare type VariableMap = {
5 [name: string]: any;
6};
7export declare type ResultMapper = (values: {
8 [fieldName: string]: any;
9}, rootValue: any) => any;
10export declare type FragmentMatcher = (rootValue: any, typeCondition: string, context: any) => boolean;
11export declare type ExecContext = {
12 fragmentMap: FragmentMap;
13 contextValue: any;
14 variableValues: VariableMap;
15 resultMapper: ResultMapper;
16 resolver: Resolver;
17 fragmentMatcher: FragmentMatcher;
18};
19export declare type ExecInfo = {
20 isLeaf: boolean;
21 resultKey: string;
22 directives: DirectiveInfo;
23 field: FieldNode;
24};
25export declare type ExecOptions = {
26 resultMapper?: ResultMapper;
27 fragmentMatcher?: FragmentMatcher;
28};
29export declare function graphql(resolver: Resolver, document: DocumentNode, rootValue?: any, contextValue?: any, variableValues?: VariableMap, execOptions?: ExecOptions): any;
30export declare function merge(dest: any, src: any): void;
31//# sourceMappingURL=graphql.d.ts.map
\No newline at end of file