aboutsummaryrefslogtreecommitdiff
path: root/source/library/fetcher/types.ts
blob: af849a943624a09787cf02314aaa84e2153d7f85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*** EXPORT ------------------------------------------- ***/

export type FetcherRequest = {
  headers?: Record<string, string>;
  operationName?: string | null;
  query: string;
  variables?: Record<string, unknown>;
};

export type FetcherResult = Record<string, unknown>;
export type Fetcher = (req: FetcherRequest) => Promise<FetcherResult> | AsyncIterable<FetcherResult>;

export type FetcherOptions = {
  fetch?: typeof globalThis.fetch;
  headers?: Record<string, string>;
  url: string;
};