1 | import { ASTNode, print } from 'graphql';
|
2 | import { Operation } from '../core';
|
3 | export interface Printer {
|
4 | (node: ASTNode, originalPrint: typeof print): string;
|
5 | }
|
6 | export interface UriFunction {
|
7 | (operation: Operation): string;
|
8 | }
|
9 | export interface Body {
|
10 | query?: string;
|
11 | operationName?: string;
|
12 | variables?: Record<string, any>;
|
13 | extensions?: Record<string, any>;
|
14 | }
|
15 | export interface HttpOptions {
|
16 | uri?: string | UriFunction;
|
17 | includeExtensions?: boolean;
|
18 | fetch?: WindowOrWorkerGlobalScope['fetch'];
|
19 | headers?: any;
|
20 | credentials?: string;
|
21 | fetchOptions?: any;
|
22 | useGETForQueries?: boolean;
|
23 | includeUnusedVariables?: boolean;
|
24 | print?: Printer;
|
25 | }
|
26 | export interface HttpQueryOptions {
|
27 | includeQuery?: boolean;
|
28 | includeExtensions?: boolean;
|
29 | }
|
30 | export interface HttpConfig {
|
31 | http?: HttpQueryOptions;
|
32 | options?: any;
|
33 | headers?: any;
|
34 | credentials?: any;
|
35 | }
|
36 | export declare const fallbackHttpConfig: {
|
37 | http: HttpQueryOptions;
|
38 | headers: {
|
39 | accept: string;
|
40 | 'content-type': string;
|
41 | };
|
42 | options: {
|
43 | method: string;
|
44 | };
|
45 | };
|
46 | export declare const defaultPrinter: Printer;
|
47 | export declare function selectHttpOptionsAndBody(operation: Operation, fallbackConfig: HttpConfig, ...configs: Array<HttpConfig>): {
|
48 | options: HttpConfig & Record<string, any>;
|
49 | body: Body;
|
50 | };
|
51 | export declare function selectHttpOptionsAndBodyInternal(operation: Operation, printer: Printer, ...configs: HttpConfig[]): {
|
52 | options: HttpConfig & Record<string, any>;
|
53 | body: Body;
|
54 | };
|
55 |
|
\ | No newline at end of file |