UNPKG

1.27 kBTypeScriptView Raw
1import Observable from 'zen-observable-ts';
2import { DocumentNode } from 'graphql/language/ast';
3import { ExecutionResult as GraphQLExecutionResult } from 'graphql';
4export { DocumentNode };
5export interface ExecutionResult<TData = {
6 [key: string]: any;
7}> extends GraphQLExecutionResult {
8 data?: TData | null;
9}
10export interface GraphQLRequest {
11 query: DocumentNode;
12 variables?: Record<string, any>;
13 operationName?: string;
14 context?: Record<string, any>;
15 extensions?: Record<string, any>;
16}
17export interface Operation {
18 query: DocumentNode;
19 variables: Record<string, any>;
20 operationName: string;
21 extensions: Record<string, any>;
22 setContext: (context: Record<string, any>) => Record<string, any>;
23 getContext: () => Record<string, any>;
24 toKey: () => string;
25}
26export declare type FetchResult<TData = {
27 [key: string]: any;
28}, C = Record<string, any>, E = Record<string, any>> = ExecutionResult<TData> & {
29 extensions?: E;
30 context?: C;
31};
32export declare type NextLink = (operation: Operation) => Observable<FetchResult>;
33export declare type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;
34//# sourceMappingURL=types.d.ts.map
\No newline at end of file