1 | import { Operation } from 'apollo-link';
|
2 | import { InvariantError } from 'ts-invariant';
|
3 | export declare type ServerError = Error & {
|
4 | response: Response;
|
5 | result: Record<string, any>;
|
6 | statusCode: number;
|
7 | };
|
8 | export declare type ServerParseError = Error & {
|
9 | response: Response;
|
10 | statusCode: number;
|
11 | bodyText: string;
|
12 | };
|
13 | export declare type ClientParseError = InvariantError & {
|
14 | parseError: Error;
|
15 | };
|
16 | export interface HttpQueryOptions {
|
17 | includeQuery?: boolean;
|
18 | includeExtensions?: boolean;
|
19 | }
|
20 | export interface HttpConfig {
|
21 | http?: HttpQueryOptions;
|
22 | options?: any;
|
23 | headers?: any;
|
24 | credentials?: any;
|
25 | }
|
26 | export interface UriFunction {
|
27 | (operation: Operation): string;
|
28 | }
|
29 | export interface Body {
|
30 | query?: string;
|
31 | operationName?: string;
|
32 | variables?: Record<string, any>;
|
33 | extensions?: Record<string, any>;
|
34 | }
|
35 | export interface HttpOptions {
|
36 | uri?: string | UriFunction;
|
37 | includeExtensions?: boolean;
|
38 | fetch?: WindowOrWorkerGlobalScope['fetch'];
|
39 | headers?: any;
|
40 | credentials?: string;
|
41 | fetchOptions?: any;
|
42 | }
|
43 | export declare const fallbackHttpConfig: {
|
44 | http: HttpQueryOptions;
|
45 | headers: {
|
46 | accept: string;
|
47 | 'content-type': string;
|
48 | };
|
49 | options: {
|
50 | method: string;
|
51 | };
|
52 | };
|
53 | export declare const throwServerError: (response: any, result: any, message: any) => never;
|
54 | export declare const parseAndCheckHttpResponse: (operations: any) => (response: Response) => Promise<any>;
|
55 | export declare const checkFetcher: (fetcher: (input: RequestInfo, init?: RequestInit) => Promise<Response>) => void;
|
56 | export declare const createSignalIfSupported: () => {
|
57 | controller: any;
|
58 | signal: any;
|
59 | };
|
60 | export declare const selectHttpOptionsAndBody: (operation: Operation, fallbackConfig: HttpConfig, ...configs: HttpConfig[]) => {
|
61 | options: HttpConfig & Record<string, any>;
|
62 | body: Body;
|
63 | };
|
64 | export declare const serializeFetchParameter: (p: any, label: any) => any;
|
65 | export declare const selectURI: (operation: any, fallbackURI?: string | ((operation: Operation) => string)) => any;
|
66 |
|
\ | No newline at end of file |