Skip to content

Commit b04a5a5

Browse files
authored
Upgrade to @apollo/client v3 (rubengrill#8)
* Upgrade to @apollo/client v3 * Use apollo client 3.3.6
1 parent 227c659 commit b04a5a5

File tree

16 files changed

+249
-248
lines changed

16 files changed

+249
-248
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ generates:
5858
5959
`tsconfig.json`:
6060

61-
Add `node_modules/apollo-typed-documents/lib/reactHooks.d.ts` in `include` to override the typings for `@apollo/react-hooks`, so that types can be inferred from typed documents.
61+
Add `node_modules/apollo-typed-documents/lib/reactHooks.d.ts` in `include` to override the typings for hooks of `@apollo/client`, so that types can be inferred from typed documents.
6262

6363
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./examples/docs/tsconfig.json) -->
6464
<!-- The below code snippet is automatically added from ./examples/docs/tsconfig.json -->
@@ -145,7 +145,7 @@ declare module "*/createAuthor.graphql" {
145145
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./examples/docs/src/AuthorList.js) -->
146146
<!-- The below code snippet is automatically added from ./examples/docs/src/AuthorList.js -->
147147
```js
148-
import { useMutation, useQuery } from "@apollo/react-hooks";
148+
import { useMutation, useQuery } from "@apollo/client";
149149
import React from "react";
150150
151151
import authorsQuery from "./authors.graphql";
@@ -222,7 +222,7 @@ module.exports = override(useBabelRc());
222222
}
223223
```
224224

225-
If you have a TypeScript app, you need to override the `@apollo/react-hooks` types in `tsconfig.json`:
225+
If you have a TypeScript app, you need to override the `@apollo/client` types for hooks in `tsconfig.json`:
226226

227227
`tsconfig.json`
228228

examples/cra-ts/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@apollo/react-hooks": "^3.1.5",
7-
"@apollo/react-testing": "^3.1.4",
6+
"@apollo/client": "^3.3.6",
87
"@testing-library/jest-dom": "^5.11.6",
98
"@testing-library/react": "^11.2.2",
109
"@testing-library/user-event": "^12.6.0",

examples/cra-ts/src/App.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MockedProvider } from "@apollo/react-testing";
1+
import { MockedProvider } from "@apollo/client/testing";
22
import { fireEvent, render, waitFor } from "@testing-library/react";
33
import React from "react";
44

examples/cra-ts/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMutation, useQuery } from "@apollo/react-hooks";
1+
import { useMutation, useQuery } from "@apollo/client";
22
import React from "react";
33

44
import authorsQuery from "./authors.graphql";

examples/cra-ts/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MockedProvider } from "@apollo/react-testing";
1+
import { MockedProvider } from "@apollo/client/testing";
22
import { GraphQLError } from "graphql";
33
import React from "react";
44
import ReactDOM from "react-dom";

examples/cra-ts/yarn.lock

Lines changed: 80 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,24 @@
22
# yarn lockfile v1
33

44

5-
"@apollo/react-common@^3.1.4":
6-
version "3.1.4"
7-
resolved "https://registry.yarnpkg.com/@apollo/react-common/-/react-common-3.1.4.tgz#ec13c985be23ea8e799c9ea18e696eccc97be345"
8-
integrity sha512-X5Kyro73bthWSCBJUC5XYQqMnG0dLWuDZmVkzog9dynovhfiVCV4kPSdgSIkqnb++cwCzOVuQ4rDKVwo2XRzQA==
9-
dependencies:
10-
ts-invariant "^0.4.4"
11-
tslib "^1.10.0"
12-
13-
"@apollo/react-hooks@^3.1.5":
14-
version "3.1.5"
15-
resolved "https://registry.yarnpkg.com/@apollo/react-hooks/-/react-hooks-3.1.5.tgz#7e710be52461255ae7fc0b3b9c2ece64299c10e6"
16-
integrity sha512-y0CJ393DLxIIkksRup4nt+vSjxalbZBXnnXxYbviq/woj+zKa431zy0yT4LqyRKpFy9ahMIwxBnBwfwIoupqLQ==
17-
dependencies:
18-
"@apollo/react-common" "^3.1.4"
19-
"@wry/equality" "^0.1.9"
20-
ts-invariant "^0.4.4"
21-
tslib "^1.10.0"
22-
23-
"@apollo/react-testing@^3.1.4":
24-
version "3.1.4"
25-
resolved "https://registry.yarnpkg.com/@apollo/react-testing/-/react-testing-3.1.4.tgz#f2e1b9b65a0bd773facf54db4fdb5995d162a72a"
26-
integrity sha512-1eKjN36UfIAnBVmfLbl12vQ/eCjTqYdaU95chGIQzT2uHd5BnasJu0z+MwXBrEs57A9WY9mFvLZxdjzQJXaacA==
27-
dependencies:
28-
"@apollo/react-common" "^3.1.4"
5+
"@apollo/client@^3.3.6":
6+
version "3.3.6"
7+
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.3.6.tgz#f359646308167f38d5bc498dfc2344c888400093"
8+
integrity sha512-XSm/STyNS8aHdDigLLACKNMHwI0qaQmEHWHtTP+jHe/E1wZRnn66VZMMgwKLy2V4uHISHfmiZ4KpUKDPeJAKqg==
9+
dependencies:
10+
"@graphql-typed-document-node/core" "^3.0.0"
11+
"@types/zen-observable" "^0.8.0"
12+
"@wry/context" "^0.5.2"
13+
"@wry/equality" "^0.3.0"
2914
fast-json-stable-stringify "^2.0.0"
15+
graphql-tag "^2.11.0"
16+
hoist-non-react-statics "^3.3.2"
17+
optimism "^0.13.1"
18+
prop-types "^15.7.2"
19+
symbol-observable "^2.0.0"
20+
ts-invariant "^0.6.0"
3021
tslib "^1.10.0"
22+
zen-observable "^0.8.14"
3123

3224
"@ardatan/[email protected]":
3325
version "0.0.6"
@@ -1277,6 +1269,11 @@
12771269
camel-case "4.1.2"
12781270
tslib "~2.0.1"
12791271

1272+
"@graphql-typed-document-node/core@^3.0.0":
1273+
version "3.1.0"
1274+
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950"
1275+
integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==
1276+
12801277
12811278
version "2.1.4"
12821279
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
@@ -1936,6 +1933,11 @@
19361933
dependencies:
19371934
source-map "^0.6.1"
19381935

1936+
"@types/ungap__global-this@^0.3.1":
1937+
version "0.3.1"
1938+
resolved "https://registry.yarnpkg.com/@types/ungap__global-this/-/ungap__global-this-0.3.1.tgz#18ce9f657da556037a29d50604335614ce703f4c"
1939+
integrity sha512-+/DsiV4CxXl6ZWefwHZDXSe1Slitz21tom38qPCaG0DYCS1NnDPIQDTKcmQ/tvK/edJUKkmuIDBJbmKDiB0r/g==
1940+
19391941
"@types/webpack-sources@*":
19401942
version "2.1.0"
19411943
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-2.1.0.tgz#8882b0bd62d1e0ce62f183d0d01b72e6e82e8c10"
@@ -1969,6 +1971,11 @@
19691971
dependencies:
19701972
"@types/yargs-parser" "*"
19711973

1974+
"@types/zen-observable@^0.8.0":
1975+
version "0.8.1"
1976+
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.1.tgz#5668c0bce55a91f2b9566b1d8a4c0a8dbbc79764"
1977+
integrity sha512-wmk0xQI6Yy7Fs/il4EpOcflG4uonUpYGqvZARESLc2oy4u69fkatFLbJOeW4Q6awO15P4rduAe6xkwHevpXcUQ==
1978+
19721979
"@typescript-eslint/eslint-plugin@^4.5.0":
19731980
version "4.11.0"
19741981
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.11.0.tgz#bc6c1e4175c0cf42083da4314f7931ad12f731cc"
@@ -2076,6 +2083,11 @@
20762083
"@typescript-eslint/types" "4.11.0"
20772084
eslint-visitor-keys "^2.0.0"
20782085

2086+
"@ungap/global-this@^0.4.2":
2087+
version "0.4.3"
2088+
resolved "https://registry.yarnpkg.com/@ungap/global-this/-/global-this-0.4.3.tgz#44cb668b03e7c4bc88cb6e6f9329d381131878ee"
2089+
integrity sha512-MuHEpDBurNVeD6mV9xBcAN2wfTwuaFQhHuhWkJuXmyVJ5P5sBCw+nnFpdfb0tAvgWkfefWCsAoAsh7MTUr3LPg==
2090+
20792091
"@webassemblyjs/[email protected]":
20802092
version "1.9.0"
20812093
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"
@@ -2221,12 +2233,19 @@
22212233
"@webassemblyjs/wast-parser" "1.9.0"
22222234
"@xtuc/long" "4.2.2"
22232235

2224-
"@wry/equality@^0.1.9":
2225-
version "0.1.11"
2226-
resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.11.tgz#35cb156e4a96695aa81a9ecc4d03787bc17f1790"
2227-
integrity sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==
2236+
"@wry/context@^0.5.2":
2237+
version "0.5.3"
2238+
resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.5.3.tgz#537db8a5b51f98507dc38f869b3a48c672f48942"
2239+
integrity sha512-n0uKHiWpf2ArHhmcHcUsKA+Dj0gtye/h56VmsDcoMRuK/ZPFeHKi8ck5L/ftqtF12ZbQR9l8xMPV7y+xybaRDA==
22282240
dependencies:
2229-
tslib "^1.9.3"
2241+
tslib "^1.14.1"
2242+
2243+
"@wry/equality@^0.3.0":
2244+
version "0.3.1"
2245+
resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.3.1.tgz#81080cdc2e0d8265cd303faa0c64b38a77884e06"
2246+
integrity sha512-8/Ftr3jUZ4EXhACfSwPIfNsE8V6WKesdjp+Dxi78Bej6qlasAxiz0/F8j0miACRj9CL4vC5Y5FsfwwEYAuhWbg==
2247+
dependencies:
2248+
tslib "^1.14.1"
22302249

22312250
"@xtuc/ieee754@^1.2.0":
22322251
version "1.2.0"
@@ -5659,6 +5678,13 @@ hmac-drbg@^1.0.0:
56595678
minimalistic-assert "^1.0.0"
56605679
minimalistic-crypto-utils "^1.0.1"
56615680

5681+
hoist-non-react-statics@^3.3.2:
5682+
version "3.3.2"
5683+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
5684+
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
5685+
dependencies:
5686+
react-is "^16.7.0"
5687+
56625688
hoopy@^0.1.4:
56635689
version "0.1.4"
56645690
resolved "https://registry.yarnpkg.com/hoopy/-/hoopy-0.1.4.tgz#609207d661100033a9a9402ad3dea677381c1b1d"
@@ -7927,6 +7953,13 @@ opn@^5.5.0:
79277953
dependencies:
79287954
is-wsl "^1.1.0"
79297955

7956+
optimism@^0.13.1:
7957+
version "0.13.2"
7958+
resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.13.2.tgz#002a438b69652bfe8f8754a4493ed35c2e9d9821"
7959+
integrity sha512-kJkpDUEs/Rp8HsAYYlDzyvQHlT6YZa95P+2GGNR8p/VvsIkt6NilAk7oeTvMRKCq7BeclB7+bmdIexog2859GQ==
7960+
dependencies:
7961+
"@wry/context" "^0.5.2"
7962+
79307963
79317964
version "5.0.4"
79327965
resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.4.tgz#85883c6528aaa02e30bbad9908c92926bb52dc90"
@@ -9306,7 +9339,7 @@ react-error-overlay@^6.0.8:
93069339
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.8.tgz#474ed11d04fc6bda3af643447d85e9127ed6b5de"
93079340
integrity sha512-HvPuUQnLp5H7TouGq3kzBeioJmXms1wHy9EGjz2OURWBp4qZO6AfGEcnxts1D/CbwPLRAgTMPCEgYhA3sEM4vw==
93089341

9309-
react-is@^16.8.1:
9342+
react-is@^16.7.0, react-is@^16.8.1:
93109343
version "16.13.1"
93119344
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
93129345
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -10668,6 +10701,11 @@ svgo@^1.0.0, svgo@^1.2.2:
1066810701
unquote "~1.1.1"
1066910702
util.promisify "~1.0.0"
1067010703

10704+
symbol-observable@^2.0.0:
10705+
version "2.0.3"
10706+
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a"
10707+
integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==
10708+
1067110709
symbol-tree@^3.2.4:
1067210710
version "3.2.4"
1067310711
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
@@ -10895,11 +10933,13 @@ tryer@^1.0.1:
1089510933
resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8"
1089610934
integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==
1089710935

10898-
ts-invariant@^0.4.4:
10899-
version "0.4.4"
10900-
resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86"
10901-
integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==
10936+
ts-invariant@^0.6.0:
10937+
version "0.6.0"
10938+
resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.6.0.tgz#44066ecfeb7a806ff1c3b0b283408a337a885412"
10939+
integrity sha512-caoafsfgb8QxdrKzFfjKt627m4i8KTtfAiji0DYJfWI4A/S9ORNNpzYuD9br64kyKFgxn9UNaLLbSupam84mCA==
1090210940
dependencies:
10941+
"@types/ungap__global-this" "^0.3.1"
10942+
"@ungap/global-this" "^0.4.2"
1090310943
tslib "^1.9.3"
1090410944

1090510945
[email protected], ts-pnp@^1.1.6:
@@ -10917,7 +10957,7 @@ tsconfig-paths@^3.9.0:
1091710957
minimist "^1.2.0"
1091810958
strip-bom "^3.0.0"
1091910959

10920-
tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
10960+
tslib@^1.10.0, tslib@^1.14.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
1092110961
version "1.14.1"
1092210962
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
1092310963
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
@@ -11828,3 +11868,8 @@ yocto-queue@^0.1.0:
1182811868
version "0.1.0"
1182911869
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
1183011870
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
11871+
11872+
zen-observable@^0.8.14:
11873+
version "0.8.15"
11874+
resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
11875+
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==

examples/cra/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@apollo/react-hooks": "^3.1.5",
7-
"@apollo/react-testing": "^3.1.4",
6+
"@apollo/client": "^3.3.6",
87
"@testing-library/jest-dom": "^5.11.6",
98
"@testing-library/react": "^11.2.2",
109
"@testing-library/user-event": "^12.6.0",

examples/cra/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMutation, useQuery } from "@apollo/react-hooks";
1+
import { useMutation, useQuery } from "@apollo/client";
22
import React from "react";
33

44
import authorsQuery from "./authors.graphql";

examples/cra/src/App.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MockedProvider } from "@apollo/react-testing";
1+
import { MockedProvider } from "@apollo/client/testing";
22
import { fireEvent, render, waitFor } from "@testing-library/react";
33
import React from "react";
44

examples/cra/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MockedProvider } from "@apollo/react-testing";
1+
import { MockedProvider } from "@apollo/client/testing";
22
import { GraphQLError } from "graphql";
33
import React from "react";
44
import ReactDOM from "react-dom";

0 commit comments

Comments
 (0)