Skip to content

Commit

Permalink
add fetch option
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoppippi committed Jun 17, 2023
1 parent 1a9cdac commit a6e0b40
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type ClientOptions = {
headers?: HeadersInit
defaults?: ReactClientDefaults
cacheOptions?: CacheOptions
fetch?: typeof globalThis.fetch
}

// TODO
Expand All @@ -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: {
Expand Down

0 comments on commit a6e0b40

Please sign in to comment.