UNPKG

1.29 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}
20export declare type Body = {
21 query?: string;
22 variables?: Record<string, any>;
23 operationName?: string;
24 extensions?: Record<string, any>;
25};
26export interface Context extends FetchOptions, HttpRequestOptions {
27}
28export declare type Request = {
29 method: string;
30 url: string;
31 body: Body | Body[];
32 options: HttpRequestOptions;
33};
34export declare type ExtractFiles = (body: Body | Body[]) => {
35 clone: Body;
36 files: Map<any, any>;
37};
38export declare type BatchOptions = {
39 batchMax?: number;
40 batchInterval?: number;
41 batchKey?: (operation: Operation) => string;
42} & Options;