UNPKG

1.36 kBTypeScriptView Raw
1import { DocumentNode } from 'graphql';
2import { HttpHeaders } from '@angular/common/http';
3import { Operation } from '@apollo/client/core';
4export declare type HttpRequestOptions = {
5 headers?: HttpHeaders;
6 withCredentials?: boolean;
7 useMultipart?: boolean;
8};
9export declare type URIFunction = (operation: Operation) => string;
10export declare type FetchOptions = {
11 method?: string;
12 uri?: string | URIFunction;
13 includeExtensions?: boolean;
14 includeQuery?: boolean;
15};
16export declare type OperationPrinter = (operation: DocumentNode) => string;
17export interface Options extends FetchOptions, HttpRequestOptions {
18 operationPrinter?: OperationPrinter;
19 useGETForQueries?: boolean;
20 extractFiles?: ExtractFiles;
21}
22export declare type Body = {
23 query?: string;
24 variables?: Record<string, any>;
25 operationName?: string;
26 extensions?: Record<string, any>;
27};
28export interface Context extends FetchOptions, HttpRequestOptions {
29}
30export declare type Request = {
31 method: string;
32 url: string;
33 body: Body | Body[];
34 options: HttpRequestOptions;
35};
36export declare type ExtractFiles = (body: Body | Body[]) => {
37 clone: Body;
38 files: Map<any, any>;
39};
40export declare type BatchOptions = {
41 batchMax?: number;
42 batchInterval?: number;
43 batchKey?: (operation: Operation) => string;
44} & Options;