From a6e0b402a664c51643209d03f394c1f35b9f3ca6 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Sat, 17 Jun 2023 18:03:42 +0100 Subject: [PATCH] add fetch option --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 18618b9..2a90b69 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,6 +19,7 @@ type ClientOptions = { headers?: HeadersInit defaults?: ReactClientDefaults cacheOptions?: CacheOptions + fetch?: typeof globalThis.fetch } // TODO @@ -33,6 +34,7 @@ function createQueryFetcher (options: ClientOptions): QueryFetcher { { query, variables, operationName }, fetchOptions ) { + const fetch = options.fetch ?? globalThis.fetch const response = await fetch(options.url, { method: "POST", headers: {