Skip to content

Commit 471fd33

Browse files
authored
Merge pull request #30 from lquixada/master
now React Native compatible.
2 parents 86e2647 + 44de8cb commit 471fd33

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
"typescript": "^2.4.2"
4040
},
4141
"dependencies": {
42-
"isomorphic-fetch": "^2.2.1"
42+
"cross-fetch": "0.0.8"
4343
}
4444
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ClientError, Options, Variables } from './types'
22
export { ClientError } from './types'
3-
import 'isomorphic-fetch'
3+
import 'cross-fetch/polyfill'
44

55
export async function request<T extends any> (url: string, query: string, variables?: Variables): Promise<T> {
66
const client = new GraphQLClient(url)

yarn.lock

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ ava-init@^0.2.0:
193193
read-pkg-up "^2.0.0"
194194
write-pkg "^2.0.0"
195195

196-
ava@^0.21.0:
197-
version "0.21.0"
198-
resolved "https://registry.yarnpkg.com/ava/-/ava-0.21.0.tgz#cd8d8ea3546f57150dea38548b9f72f8ca583d29"
196+
ava@^0.22.0:
197+
version "0.22.0"
198+
resolved "https://registry.yarnpkg.com/ava/-/ava-0.22.0.tgz#4c28a1fdef7e749ba0c8131ac18a7ca489eef049"
199199
dependencies:
200200
"@ava/babel-preset-stage-4" "^1.1.0"
201201
"@ava/babel-preset-transform-test-files" "^3.0.0"
@@ -879,6 +879,13 @@ create-error-class@^3.0.0:
879879
dependencies:
880880
capture-stack-trace "^1.0.0"
881881

882+
cross-fetch@0.0.8:
883+
version "0.0.8"
884+
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-0.0.8.tgz#01ed94dc407df2c00f1807fde700a7cfa48a205c"
885+
dependencies:
886+
node-fetch "1.7.3"
887+
whatwg-fetch "2.0.3"
888+
882889
cross-spawn-async@^2.1.1:
883890
version "2.2.5"
884891
resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc"
@@ -1600,13 +1607,6 @@ isobject@^2.0.0:
16001607
dependencies:
16011608
isarray "1.0.0"
16021609

1603-
isomorphic-fetch@^2.2.1:
1604-
version "2.2.1"
1605-
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
1606-
dependencies:
1607-
node-fetch "^1.0.1"
1608-
whatwg-fetch ">=0.10.0"
1609-
16101610
isstream@~0.1.2:
16111611
version "0.1.2"
16121612
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
@@ -1899,7 +1899,14 @@ nan@^2.3.0:
18991899
version "2.6.2"
19001900
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
19011901

1902-
node-fetch@^1.0.1, node-fetch@^1.3.3:
1902+
node-fetch@1.7.3:
1903+
version "1.7.3"
1904+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
1905+
dependencies:
1906+
encoding "^0.1.11"
1907+
is-stream "^1.0.1"
1908+
1909+
node-fetch@^1.3.3:
19031910
version "1.7.0"
19041911
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.0.tgz#3ff6c56544f9b7fb00682338bb55ee6f54a8a0ef"
19051912
dependencies:
@@ -2818,7 +2825,7 @@ well-known-symbols@^1.0.0:
28182825
version "1.0.0"
28192826
resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-1.0.0.tgz#73c78ae81a7726a8fa598e2880801c8b16225518"
28202827

2821-
whatwg-fetch@>=0.10.0:
2828+
whatwg-fetch@2.0.3:
28222829
version "2.0.3"
28232830
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
28242831

0 commit comments

Comments
 (0)