UNPKG

1.25 kBTypeScriptView Raw
1import { GraphQLResolveInfo, GraphQLSchema } from 'graphql';
2import { Transform } from 'graphql-tools';
3export declare type Operation = 'query' | 'mutation' | 'subscription';
4export declare type QueryOrMutation = 'query' | 'mutation';
5export interface FragmentReplacement {
6 field: string;
7 fragment: string;
8}
9export interface QueryMap {
10 [rootField: string]: (args?: {
11 [key: string]: any;
12 }, info?: GraphQLResolveInfo | string, context?: {
13 [key: string]: any;
14 }) => Promise<any>;
15}
16export declare type MutationMap = QueryMap;
17export interface SubscriptionMap {
18 [rootField: string]: (args?: any, info?: GraphQLResolveInfo | string, context?: {
19 [key: string]: any;
20 }) => AsyncIterator<any> | Promise<AsyncIterator<any>>;
21}
22export interface BindingOptions {
23 fragmentReplacements?: FragmentReplacement[];
24 schema: GraphQLSchema;
25 before?: () => void;
26 disableCache?: boolean;
27}
28export interface BindingWithoutSchemaOptions {
29 fragmentReplacements?: FragmentReplacement[];
30 before?: () => void;
31}
32export interface Args {
33 [key: string]: any;
34}
35export interface Context {
36 [key: string]: any;
37}
38export interface Options {
39 transforms?: Transform[];
40 context?: Context;
41}