diff --git a/package-lock.json b/package-lock.json index 8530cfb..f32576e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@garph/gqty", - "version": "0.4.3", + "version": "0.4.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@garph/gqty", - "version": "0.4.3", + "version": "0.4.5", "license": "MIT", "dependencies": { - "@gqty/react": "^3.0.0-alpha-4ad34526.0", + "@gqty/react": "3.0.0-alpha-4a2eebdf.0", "@mishushakov/ts-load": "^1.0.1", "babel-literal-to-ast": "^2.1.0", - "gqty": "^3.0.0-alpha-4ad34526.0", + "gqty": "^3.0.0-alpha-4a2eebdf.0", "graphql": "^16.6.0" }, "devDependencies": { @@ -666,9 +666,9 @@ } }, "node_modules/@gqty/react": { - "version": "3.0.0-alpha-f9dbf6e8.0", - "resolved": "https://registry.npmjs.org/@gqty/react/-/react-3.0.0-alpha-f9dbf6e8.0.tgz", - "integrity": "sha512-bhH82S0yp42vr324fjs5gZS1jB8uzv/UgaScw6lbS9q+VhHQWyQy3/BGsuWWH5hd/ufqHXNGmeIR0/qTekBrvA==", + "version": "3.0.0-alpha-4a2eebdf.0", + "resolved": "https://registry.npmjs.org/@gqty/react/-/react-3.0.0-alpha-4a2eebdf.0.tgz", + "integrity": "sha512-O7+nTepRJH2llHROIwEQpoCamv4WNKuKGjr3uKX7+flJuPBPX96SMCkVsAig10ovx0EYCXkfhM+x8kf//inHaw==", "dependencies": { "@react-hookz/web": "^23.0.0", "multidict": "^1.0.6", @@ -681,7 +681,7 @@ "node": "^12.20.0 || >=14.13.0" }, "peerDependencies": { - "gqty": "^3.0.0-alpha-f9dbf6e8.0", + "gqty": "^3.0.0-alpha-4a2eebdf.0", "graphql": "*", "graphql-sse": "^2.1.0", "graphql-ws": "^5.11.3", @@ -1883,9 +1883,9 @@ "optional": true }, "@gqty/react": { - "version": "3.0.0-alpha-f9dbf6e8.0", - "resolved": "https://registry.npmjs.org/@gqty/react/-/react-3.0.0-alpha-f9dbf6e8.0.tgz", - "integrity": "sha512-bhH82S0yp42vr324fjs5gZS1jB8uzv/UgaScw6lbS9q+VhHQWyQy3/BGsuWWH5hd/ufqHXNGmeIR0/qTekBrvA==", + "version": "3.0.0-alpha-4a2eebdf.0", + "resolved": "https://registry.npmjs.org/@gqty/react/-/react-3.0.0-alpha-4a2eebdf.0.tgz", + "integrity": "sha512-O7+nTepRJH2llHROIwEQpoCamv4WNKuKGjr3uKX7+flJuPBPX96SMCkVsAig10ovx0EYCXkfhM+x8kf//inHaw==", "requires": { "@react-hookz/web": "^23.0.0", "multidict": "^1.0.6", diff --git a/package.json b/package.json index 04cddbe..0b942c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@garph/gqty", - "version": "0.4.3", + "version": "0.4.5", "description": "tRPC-style client for Garph", "main": "dist/index.js", "scripts": { @@ -18,10 +18,10 @@ }, "homepage": "https://github.com/stepci/garph-gqty#readme", "dependencies": { - "@gqty/react": "^3.0.0-alpha-4ad34526.0", + "@gqty/react": "3.0.0-alpha-4a2eebdf.0", "@mishushakov/ts-load": "^1.0.1", "babel-literal-to-ast": "^2.1.0", - "gqty": "^3.0.0-alpha-4ad34526.0", + "gqty": "^3.0.0-alpha-4a2eebdf.0", "graphql": "^16.6.0" }, "devDependencies": { 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: {