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: {