1 | import Observable from 'zen-observable-ts';
|
2 | import { DocumentNode } from 'graphql/language/ast';
|
3 | import { ExecutionResult as GraphQLExecutionResult } from 'graphql';
|
4 | export { DocumentNode };
|
5 | export interface ExecutionResult<TData = {
|
6 | [key: string]: any;
|
7 | }> extends GraphQLExecutionResult {
|
8 | data?: TData | null;
|
9 | }
|
10 | export interface GraphQLRequest {
|
11 | query: DocumentNode;
|
12 | variables?: Record<string, any>;
|
13 | operationName?: string;
|
14 | context?: Record<string, any>;
|
15 | extensions?: Record<string, any>;
|
16 | }
|
17 | export 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 | }
|
26 | export 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 | };
|
32 | export declare type NextLink = (operation: Operation) => Observable<FetchResult>;
|
33 | export declare type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;
|
34 |
|
\ | No newline at end of file |