Skip to content

Commit 32456de

Browse files
authored
minor: upgrade to apollo/client (v3) (#8)
* minor: upgrade to apollo/client (v3) Signed-off-by: sirugh <rugh@adobe.com> * add react Signed-off-by: sirugh <rugh@adobe.com> * upgrade all deps to latest, except react Signed-off-by: sirugh <rugh@adobe.com> * remove react and react-refresh Signed-off-by: sirugh <rugh@adobe.com>
1 parent 193b087 commit 32456de

File tree

5 files changed

+162
-76
lines changed

5 files changed

+162
-76
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Compose your link chain with the link.
1616
import MutationQueueLink from "apollo-link-mutation-queue";
1717

1818
const link = ApolloLink.from([
19-
new MutationQueueLink()
19+
new MutationQueueLink(),
2020
//... your other links
2121
]);
2222
```
@@ -27,7 +27,7 @@ Debug with `debug: true`.
2727
import MutationQueueLink from "apollo-link-mutation-queue";
2828

2929
const link = ApolloLink.from([
30-
new MutationQueueLink({ debug: true })
30+
new MutationQueueLink({ debug: true }),
3131
//... your other links
3232
]);
3333
```
@@ -39,7 +39,7 @@ const [mutate] = useMutation(MY_MUTATION);
3939

4040
useEffect(() => {
4141
mutate({
42-
context: { skipQueue: true }
42+
context: { skipQueue: true },
4343
});
4444
}, []);
4545
```
@@ -51,3 +51,7 @@ Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING
5151
### Licensing
5252

5353
This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.
54+
55+
### Note
56+
57+
The upgrade to `@apollo/client` requires `react` and `react-refresh` as dependencies.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
"author": "Stephen Rugh <rugh@adobe.com>",
1919
"license": "Apache-2.0",
2020
"dependencies": {
21-
"apollo-link": "~1.2.13"
21+
"@apollo/client": "^3.0.0",
22+
"zen-observable-ts": "^1.0.0"
2223
},
2324
"devDependencies": {
2425
"@types/graphql": "^14.5.0",
25-
"@types/node": "^13.9.0",
26-
"typescript": "^3.8.3"
26+
"@types/node": "^17.0.0",
27+
"typescript": "^4.0.0"
2728
}
2829
}

src/MutationQueueLink.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
99
OF ANY KIND, either express or implied. See the License for the specific language
1010
governing permissions and limitations under the License.
1111
*/
12-
import {
13-
ApolloLink,
14-
Observable,
15-
Operation,
16-
FetchResult,
17-
NextLink,
18-
} from "apollo-link";
19-
import { Observer } from "zen-observable-ts";
12+
import { ApolloLink, Operation, FetchResult, NextLink } from "@apollo/client";
13+
import { Observer, Observable } from "zen-observable-ts";
2014

2115
interface OperationQueueEntry {
2216
operation: Operation;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"compilerOptions": {
3+
"allowSyntheticDefaultImports": true,
34
"declaration": true,
45
"module": "commonjs",
56
"moduleResolution": "node",
67
"noImplicitAny": true,
7-
"lib": ["esnext"],
8+
"lib": ["dom", "esnext"],
89
"removeComments": false,
910
"preserveConstEnums": true,
1011
"outDir": "dist",

yarn.lock

Lines changed: 147 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,174 @@
22
# yarn lockfile v1
33

44

5+
"@apollo/client@^3.0.0":
6+
version "3.6.1"
7+
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.6.1.tgz#2578aa3c06e4b8c41060936b9e508beb1abc1bab"
8+
integrity sha512-WGC7n2IS7GIbCCfVvu58Qncmj6qUBYbI/DxPVHGffDuY5y5l+OI2YIr5UXyR8+G9Ly1d6iYbX6l6l+Rw6F6gHA==
9+
dependencies:
10+
"@graphql-typed-document-node/core" "^3.1.1"
11+
"@wry/context" "^0.6.0"
12+
"@wry/equality" "^0.5.0"
13+
"@wry/trie" "^0.3.0"
14+
graphql-tag "^2.12.6"
15+
hoist-non-react-statics "^3.3.2"
16+
optimism "^0.16.1"
17+
prop-types "^15.7.2"
18+
symbol-observable "^4.0.0"
19+
ts-invariant "^0.10.0"
20+
tslib "^2.3.0"
21+
use-sync-external-store "^1.0.0"
22+
zen-observable-ts "^1.2.0"
23+
24+
"@graphql-typed-document-node/core@^3.1.1":
25+
version "3.1.1"
26+
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.1.tgz#076d78ce99822258cf813ecc1e7fa460fa74d052"
27+
integrity sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==
28+
529
"@types/graphql@^14.5.0":
630
version "14.5.0"
731
resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-14.5.0.tgz#a545fb3bc8013a3547cf2f07f5e13a33642b75d6"
832
integrity sha512-MOkzsEp1Jk5bXuAsHsUi6BVv0zCO+7/2PTiZMXWDSsMXvNU6w/PLMQT2vHn8hy2i0JqojPz1Sz6rsFjHtsU0lA==
933
dependencies:
1034
graphql "*"
1135

12-
"@types/node@^13.9.0":
13-
version "13.9.0"
14-
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.9.0.tgz#5b6ee7a77faacddd7de719017d0bc12f52f81589"
15-
integrity sha512-0ARSQootUG1RljH2HncpsY2TJBfGQIKOOi7kxzUY6z54ePu/ZD+wJA8zI2Q6v8rol2qpG/rvqsReco8zNMPvhQ==
36+
"@types/node@^17.0.0":
37+
version "17.0.30"
38+
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.30.tgz#2c6e8512acac70815e8176aa30c38025067880ef"
39+
integrity sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw==
1640

17-
"@wry/equality@^0.1.2":
18-
version "0.1.9"
19-
resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.9.tgz#b13e18b7a8053c6858aa6c85b54911fb31e3a909"
20-
integrity sha512-mB6ceGjpMGz1ZTza8HYnrPGos2mC6So4NhS1PtZ8s4Qt0K7fBiIGhpSxUbQmhwcSWE3no+bYxmI2OL6KuXYmoQ==
41+
"@types/zen-observable@0.8.3":
42+
version "0.8.3"
43+
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.3.tgz#781d360c282436494b32fe7d9f7f8e64b3118aa3"
44+
integrity sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==
45+
46+
"@wry/context@^0.6.0":
47+
version "0.6.0"
48+
resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.6.0.tgz#f903eceb89d238ef7e8168ed30f4511f92d83e06"
49+
integrity sha512-sAgendOXR8dM7stJw3FusRxFHF/ZinU0lffsA2YTyyIOfic86JX02qlPqPVqJNZJPAxFt+2EE8bvq6ZlS0Kf+Q==
2150
dependencies:
22-
tslib "^1.9.3"
51+
tslib "^2.1.0"
2352

24-
apollo-link@~1.2.13:
25-
version "1.2.13"
26-
resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.13.tgz#dff00fbf19dfcd90fddbc14b6a3f9a771acac6c4"
27-
integrity sha512-+iBMcYeevMm1JpYgwDEIDt/y0BB7VWyvlm/7x+TIPNLHCTCMgcEgDuW5kH86iQZWo0I7mNwQiTOz+/3ShPFmBw==
53+
"@wry/equality@^0.5.0":
54+
version "0.5.2"
55+
resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.2.tgz#72c8a7a7d884dff30b612f4f8464eba26c080e73"
56+
integrity sha512-oVMxbUXL48EV/C0/M7gLVsoK6qRHPS85x8zECofEZOVvxGmIPLA9o5Z27cc2PoAyZz1S2VoM2A7FLAnpfGlneA==
2857
dependencies:
29-
apollo-utilities "^1.3.0"
30-
ts-invariant "^0.4.0"
31-
tslib "^1.9.3"
32-
zen-observable-ts "^0.8.20"
33-
34-
apollo-utilities@^1.3.0:
35-
version "1.3.3"
36-
resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.3.tgz#f1854715a7be80cd810bc3ac95df085815c0787c"
37-
integrity sha512-F14aX2R/fKNYMvhuP2t9GD9fggID7zp5I96MF5QeKYWDWTrkRdHRp4+SVfXUVN+cXOaB/IebfvRtzPf25CM0zw==
58+
tslib "^2.3.0"
59+
60+
"@wry/trie@^0.3.0":
61+
version "0.3.0"
62+
resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.0.tgz#3245e74988c4e3033299e479a1bf004430752463"
63+
integrity sha512-Yw1akIogPhAT6XPYsRHlZZIS0tIGmAl9EYXHi2scf7LPKKqdqmow/Hu4kEqP2cJR3EjaU/9L0ZlAjFf3hFxmug==
3864
dependencies:
39-
"@wry/equality" "^0.1.2"
40-
fast-json-stable-stringify "^2.0.0"
41-
ts-invariant "^0.4.0"
42-
tslib "^1.10.0"
65+
tslib "^2.1.0"
4366

44-
fast-json-stable-stringify@^2.0.0:
45-
version "2.1.0"
46-
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
47-
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
67+
graphql-tag@^2.12.6:
68+
version "2.12.6"
69+
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1"
70+
integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==
71+
dependencies:
72+
tslib "^2.1.0"
4873

4974
graphql@*:
50-
version "14.6.0"
51-
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.6.0.tgz#57822297111e874ea12f5cd4419616930cd83e49"
52-
integrity sha512-VKzfvHEKybTKjQVpTFrA5yUq2S9ihcZvfJAtsDBBCuV6wauPu1xl/f9ehgVf0FcEJJs4vz6ysb/ZMkGigQZseg==
75+
version "15.5.0"
76+
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.0.tgz#39d19494dbe69d1ea719915b578bf920344a69d5"
77+
integrity sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA==
78+
79+
hoist-non-react-statics@^3.3.2:
80+
version "3.3.2"
81+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
82+
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
83+
dependencies:
84+
react-is "^16.7.0"
85+
86+
"js-tokens@^3.0.0 || ^4.0.0":
87+
version "4.0.0"
88+
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
89+
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
90+
91+
loose-envify@^1.4.0:
92+
version "1.4.0"
93+
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
94+
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
5395
dependencies:
54-
iterall "^1.2.2"
96+
js-tokens "^3.0.0 || ^4.0.0"
97+
98+
object-assign@^4.1.1:
99+
version "4.1.1"
100+
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
101+
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
55102

56-
iterall@^1.2.2:
57-
version "1.3.0"
58-
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea"
59-
integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==
103+
optimism@^0.16.1:
104+
version "0.16.1"
105+
resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.1.tgz#7c8efc1f3179f18307b887e18c15c5b7133f6e7d"
106+
integrity sha512-64i+Uw3otrndfq5kaoGNoY7pvOhSsjFEN4bdEFh80MWVk/dbgJfMv7VFDeCT8LxNAlEVhQmdVEbfE7X2nWNIIg==
107+
dependencies:
108+
"@wry/context" "^0.6.0"
109+
"@wry/trie" "^0.3.0"
60110

61-
ts-invariant@^0.4.0:
62-
version "0.4.4"
63-
resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86"
64-
integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==
111+
prop-types@^15.7.2:
112+
version "15.7.2"
113+
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
114+
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
65115
dependencies:
66-
tslib "^1.9.3"
67-
68-
tslib@^1.10.0, tslib@^1.9.3:
69-
version "1.11.1"
70-
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
71-
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
72-
73-
typescript@^3.8.3:
74-
version "3.8.3"
75-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
76-
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
77-
78-
zen-observable-ts@^0.8.20:
79-
version "0.8.20"
80-
resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.20.tgz#44091e335d3fcbc97f6497e63e7f57d5b516b163"
81-
integrity sha512-2rkjiPALhOtRaDX6pWyNqK1fnP5KkJJybYebopNSn6wDG1lxBoFs2+nwwXKoA6glHIrtwrfBBy6da0stkKtTAA==
116+
loose-envify "^1.4.0"
117+
object-assign "^4.1.1"
118+
react-is "^16.8.1"
119+
120+
react-is@^16.7.0, react-is@^16.8.1:
121+
version "16.13.1"
122+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
123+
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
124+
125+
symbol-observable@^4.0.0:
126+
version "4.0.0"
127+
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205"
128+
integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==
129+
130+
ts-invariant@^0.10.0:
131+
version "0.10.1"
132+
resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.1.tgz#df002059ffcc3f94b5064fa74e32796434cd1b06"
133+
integrity sha512-dOmY3naALBtNyK+nrVGzD8DVxSJ9OIHragItZ3XvxGORNAZL6uszgQYaD3PW+TPh2NWNsOpuQUxznuvTkmcdqw==
134+
dependencies:
135+
tslib "^2.1.0"
136+
137+
tslib@^2.1.0:
138+
version "2.2.0"
139+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c"
140+
integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==
141+
142+
tslib@^2.3.0:
143+
version "2.4.0"
144+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
145+
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
146+
147+
typescript@^4.0.0:
148+
version "4.6.4"
149+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
150+
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==
151+
152+
use-sync-external-store@^1.0.0:
153+
version "1.1.0"
154+
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.1.0.tgz#3343c3fe7f7e404db70f8c687adf5c1652d34e82"
155+
integrity sha512-SEnieB2FPKEVne66NpXPd1Np4R1lTNKfjuy3XdIoPQKYBAFdzbzSZlSn1KJZUiihQLQC5Znot4SBz1EOTBwQAQ==
156+
157+
zen-observable-ts@^1.0.0:
158+
version "1.1.0"
159+
resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.1.0.tgz#2d1aa9d79b87058e9b75698b92791c1838551f83"
160+
integrity sha512-1h4zlLSqI2cRLPJUHJFL8bCWHhkpuXkF+dbGkRaWjgDIG26DmzyshUMrdV/rL3UnR+mhaX4fRq8LPouq0MYYIA==
161+
dependencies:
162+
"@types/zen-observable" "0.8.3"
163+
zen-observable "0.8.15"
164+
165+
zen-observable-ts@^1.2.0:
166+
version "1.2.3"
167+
resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.2.3.tgz#c2f5ccebe812faf0cfcde547e6004f65b1a6d769"
168+
integrity sha512-hc/TGiPkAWpByykMwDcem3SdUgA4We+0Qb36bItSuJC9xD0XVBZoFHYoadAomDSNf64CG8Ydj0Qb8Od8BUWz5g==
82169
dependencies:
83-
tslib "^1.9.3"
84-
zen-observable "^0.8.0"
170+
zen-observable "0.8.15"
85171

86-
zen-observable@^0.8.0:
172+
zen-observable@0.8.15:
87173
version "0.8.15"
88174
resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
89175
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==

0 commit comments

Comments
 (0)