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?: Record<string, string>;
|
20 | preserveHeaderCase?: boolean;
|
21 | credentials?: string;
|
22 | fetchOptions?: any;
|
23 | useGETForQueries?: boolean;
|
24 | includeUnusedVariables?: boolean;
|
25 | print?: Printer;
|
26 | }
|
27 | export interface HttpQueryOptions {
|
28 | includeQuery?: boolean;
|
29 | includeExtensions?: boolean;
|
30 | preserveHeaderCase?: boolean;
|
31 | }
|
32 | export interface HttpConfig {
|
33 | http?: HttpQueryOptions;
|
34 | options?: any;
|
35 | headers?: Record<string, string>;
|
36 | credentials?: any;
|
37 | }
|
38 | export declare const fallbackHttpConfig: {
|
39 | http: HttpQueryOptions;
|
40 | headers: {
|
41 | accept: string;
|
42 | 'content-type': string;
|
43 | };
|
44 | options: {
|
45 | method: string;
|
46 | };
|
47 | };
|
48 | export declare const defaultPrinter: Printer;
|
49 | export declare function selectHttpOptionsAndBody(operation: Operation, fallbackConfig: HttpConfig, ...configs: Array<HttpConfig>): {
|
50 | options: HttpConfig & Record<string, any>;
|
51 | body: Body;
|
52 | };
|
53 | export declare function selectHttpOptionsAndBodyInternal(operation: Operation, printer: Printer, ...configs: HttpConfig[]): {
|
54 | options: HttpConfig & Record<string, any>;
|
55 | body: Body;
|
56 | };
|
57 |
|
\ | No newline at end of file |