@graphcommerce/graphql 3.0.3 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -71
- package/createCacheReviver.ts +7 -1
- package/package.json +14 -14
- package/{_playwright → test}/apolloClient.fixture.ts +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1368](https://github.com/graphcommerce-org/graphcommerce/pull/1368) [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a) Thanks [@paales](https://github.com/paales)! - playwright waitForGraphQlResponse shouldn’t crash on non-graphql responses
|
|
8
|
+
|
|
9
|
+
* [#1369](https://github.com/graphcommerce-org/graphcommerce/pull/1369) [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies
|
|
10
|
+
|
|
11
|
+
- [#1368](https://github.com/graphcommerce-org/graphcommerce/pull/1368) [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a) Thanks [@paales](https://github.com/paales)! - Do not recreate client cache when initialized once, fixes issue where the localStorage wasn't updated yet when a new page is loaded.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9)]:
|
|
14
|
+
- @graphcommerce/graphql-codegen-near-operation-file@3.0.9
|
|
15
|
+
- @graphcommerce/graphql-codegen-relay-optimizer-plugin@3.0.6
|
|
16
|
+
|
|
17
|
+
## 3.0.5
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#1341](https://github.com/graphcommerce-org/graphcommerce/pull/1341) [`2e29c5852`](https://github.com/graphcommerce-org/graphcommerce/commit/2e29c585247d356e3027be92beb7815f2070c855) Thanks [@paales](https://github.com/paales)! - upgrade dependencies
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`2e29c5852`](https://github.com/graphcommerce-org/graphcommerce/commit/2e29c585247d356e3027be92beb7815f2070c855)]:
|
|
24
|
+
- @graphcommerce/graphql-codegen-near-operation-file@3.0.7
|
|
25
|
+
|
|
26
|
+
## 3.0.4
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655) Thanks [@paales](https://github.com/paales)! - All default exports are now named exports internally and all `index.tsx` are renamed to the component name.
|
|
31
|
+
|
|
32
|
+
* [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef) Thanks [@paales](https://github.com/paales)! - upgrade dependencies
|
|
33
|
+
|
|
34
|
+
* Updated dependencies [[`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655), [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef)]:
|
|
35
|
+
- @graphcommerce/graphql-codegen-near-operation-file@3.0.5
|
|
36
|
+
- @graphcommerce/graphql-codegen-relay-optimizer-plugin@3.0.5
|
|
37
|
+
|
|
3
38
|
## 3.0.3
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
6
41
|
|
|
7
|
-
- [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)
|
|
8
|
-
Thanks [@paales](https://github.com/paales)! - made packages public
|
|
42
|
+
- [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96) Thanks [@paales](https://github.com/paales)! - made packages public
|
|
9
43
|
|
|
10
|
-
- Updated dependencies
|
|
11
|
-
[[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)]:
|
|
44
|
+
- Updated dependencies [[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)]:
|
|
12
45
|
- @graphcommerce/graphql-codegen-near-operation-file@3.0.3
|
|
13
46
|
- @graphcommerce/graphql-codegen-relay-optimizer-plugin@3.0.3
|
|
14
47
|
|
|
@@ -16,26 +49,13 @@
|
|
|
16
49
|
|
|
17
50
|
### Patch Changes
|
|
18
51
|
|
|
19
|
-
- [#1276](https://github.com/ho-nl/m2-pwa/pull/1276)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* [
|
|
26
|
-
[`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)
|
|
27
|
-
Thanks [@paales](https://github.com/paales)! - Upgraded to
|
|
28
|
-
[NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be
|
|
29
|
-
implementing
|
|
30
|
-
[On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta)
|
|
31
|
-
soon.
|
|
32
|
-
|
|
33
|
-
This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the
|
|
34
|
-
frontend to be able to revalidate pages manually.
|
|
35
|
-
|
|
36
|
-
* Updated dependencies
|
|
37
|
-
[[`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2),
|
|
38
|
-
[`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
|
|
52
|
+
- [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2) Thanks [@paales](https://github.com/paales)! - We've moved lots of internal packages from `dependencies` to `peerDependencies`. The result of this is that there will be significantly less duplicate packages in the node_modules folders.
|
|
53
|
+
|
|
54
|
+
* [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d) Thanks [@paales](https://github.com/paales)! - Upgraded to [NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be implementing [On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta) soon.
|
|
55
|
+
|
|
56
|
+
This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the frontend to be able to revalidate pages manually.
|
|
57
|
+
|
|
58
|
+
* Updated dependencies [[`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2), [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
|
|
39
59
|
- @graphcommerce/graphql-codegen-near-operation-file@3.0.2
|
|
40
60
|
- @graphcommerce/graphql-codegen-relay-optimizer-plugin@3.0.2
|
|
41
61
|
|
|
@@ -43,11 +63,8 @@
|
|
|
43
63
|
|
|
44
64
|
### Patch Changes
|
|
45
65
|
|
|
46
|
-
- [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)
|
|
47
|
-
|
|
48
|
-
so that the packages link to back to the website and repository
|
|
49
|
-
- Updated dependencies
|
|
50
|
-
[[`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)]:
|
|
66
|
+
- [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514) Thanks [@paales](https://github.com/paales)! - Added homepage and repository package.json files, so that the packages link to back to the website and repository
|
|
67
|
+
- Updated dependencies [[`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514)]:
|
|
51
68
|
- @graphcommerce/graphql-codegen-near-operation-file@3.0.1
|
|
52
69
|
- @graphcommerce/graphql-codegen-relay-optimizer-plugin@3.0.1
|
|
53
70
|
|
|
@@ -55,47 +72,39 @@
|
|
|
55
72
|
|
|
56
73
|
### Major Changes
|
|
57
74
|
|
|
58
|
-
- [#1258](https://github.com/ho-nl/m2-pwa/pull/1258)
|
|
59
|
-
[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)
|
|
60
|
-
Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
|
|
75
|
+
- [#1258](https://github.com/ho-nl/m2-pwa/pull/1258) [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05) Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
|
|
61
76
|
|
|
62
77
|
### Patch Changes
|
|
63
78
|
|
|
64
|
-
- Updated dependencies
|
|
65
|
-
[[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
|
|
79
|
+
- Updated dependencies [[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
|
|
66
80
|
- @graphcommerce/graphql-codegen-near-operation-file@3.0.0
|
|
67
81
|
- @graphcommerce/graphql-codegen-relay-optimizer-plugin@3.0.0
|
|
68
82
|
|
|
69
|
-
All notable changes to this project will be documented in this file. See
|
|
70
|
-
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
83
|
+
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
71
84
|
|
|
72
85
|
## [2.105.12](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.105.11...@graphcommerce/graphql@2.105.12) (2021-12-21)
|
|
73
86
|
|
|
74
87
|
### Bug Fixes
|
|
75
88
|
|
|
76
|
-
- **graphql:** make sure we're passing the correct store code to the schema endpoint
|
|
77
|
-
([39753f2](https://github.com/ho-nl/m2-pwa/commit/39753f2117ce7ba79dab035c4134e642829e7f18))
|
|
89
|
+
- **graphql:** make sure we're passing the correct store code to the schema endpoint ([39753f2](https://github.com/ho-nl/m2-pwa/commit/39753f2117ce7ba79dab035c4134e642829e7f18))
|
|
78
90
|
|
|
79
91
|
## [2.105.6](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.105.5...@graphcommerce/graphql@2.105.6) (2021-12-03)
|
|
80
92
|
|
|
81
93
|
### Bug Fixes
|
|
82
94
|
|
|
83
|
-
- make the headerHeight properly configurable
|
|
84
|
-
([c39c942](https://github.com/ho-nl/m2-pwa/commit/c39c942a62a9bb9687ea553be28e37fb49a6b065))
|
|
95
|
+
- make the headerHeight properly configurable ([c39c942](https://github.com/ho-nl/m2-pwa/commit/c39c942a62a9bb9687ea553be28e37fb49a6b065))
|
|
85
96
|
|
|
86
97
|
# [2.105.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.104.1...@graphcommerce/graphql@2.105.0) (2021-10-27)
|
|
87
98
|
|
|
88
99
|
### Features
|
|
89
100
|
|
|
90
|
-
- **nextjs:** upgraded to nextjs 12
|
|
91
|
-
([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
|
|
101
|
+
- **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
|
|
92
102
|
|
|
93
103
|
# [2.104.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.103.8...@graphcommerce/graphql@2.104.0) (2021-10-21)
|
|
94
104
|
|
|
95
105
|
### Features
|
|
96
106
|
|
|
97
|
-
- **graphql-mesh:** remove the api project and use a single project 🎉👩👩👦👦
|
|
98
|
-
([ea4ad03](https://github.com/ho-nl/m2-pwa/commit/ea4ad0397d4ff289ef3b3253593fb0914c8c5246))
|
|
107
|
+
- **graphql-mesh:** remove the api project and use a single project 🎉👩👩👦👦 ([ea4ad03](https://github.com/ho-nl/m2-pwa/commit/ea4ad0397d4ff289ef3b3253593fb0914c8c5246))
|
|
99
108
|
|
|
100
109
|
## [2.103.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.103.0...@graphcommerce/graphql@2.103.1) (2021-09-27)
|
|
101
110
|
|
|
@@ -105,57 +114,43 @@ All notable changes to this project will be documented in this file. See
|
|
|
105
114
|
|
|
106
115
|
### Bug Fixes
|
|
107
116
|
|
|
108
|
-
- ignore md files from triggering version updates
|
|
109
|
-
([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
|
|
117
|
+
- ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
|
|
110
118
|
|
|
111
119
|
### Features
|
|
112
120
|
|
|
113
|
-
- **graphql:** introduced new graphql package that holds all generated files
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
- **playwright:** added new playwright package to enable browser testing
|
|
120
|
-
([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
|
|
121
|
-
- renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of
|
|
122
|
-
[@reachdigital](https://github.com/reachdigital)
|
|
123
|
-
([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
|
|
124
|
-
- upgraded to nextjs 11
|
|
125
|
-
([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
|
|
121
|
+
- **graphql:** introduced new graphql package that holds all generated files ([a3e7aa0](https://github.com/ho-nl/m2-pwa/commit/a3e7aa05540540533b5ced9a95f1f802ecbe499f))
|
|
122
|
+
- **graphql:** introducing local schema migrations ([e77ef8a](https://github.com/ho-nl/m2-pwa/commit/e77ef8ad4cd5723e2352dec937b45ee976929b24))
|
|
123
|
+
- next.js 11 ([7d61407](https://github.com/ho-nl/m2-pwa/commit/7d614075a778f488045034f74be4f75b93f63c43))
|
|
124
|
+
- **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
|
|
125
|
+
- renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of [@reachdigital](https://github.com/reachdigital) ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
|
|
126
|
+
- upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
|
|
126
127
|
|
|
127
128
|
### Reverts
|
|
128
129
|
|
|
129
|
-
- Revert "chore: upgrade @apollo/client"
|
|
130
|
-
([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
|
|
130
|
+
- Revert "chore: upgrade @apollo/client" ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
|
|
131
131
|
|
|
132
132
|
# Change Log
|
|
133
133
|
|
|
134
|
-
All notable changes to this project will be documented in this file. See
|
|
135
|
-
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
134
|
+
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
136
135
|
|
|
137
136
|
# [2.102.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.101.3...@graphcommerce/graphql@2.102.0) (2021-08-12)
|
|
138
137
|
|
|
139
138
|
### Features
|
|
140
139
|
|
|
141
|
-
- upgraded to nextjs 11
|
|
142
|
-
([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
|
|
140
|
+
- upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
|
|
143
141
|
|
|
144
142
|
## [2.101.3](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.101.2...@graphcommerce/graphql@2.101.3) (2021-08-09)
|
|
145
143
|
|
|
146
144
|
### Reverts
|
|
147
145
|
|
|
148
|
-
- Revert "chore: upgrade @apollo/client"
|
|
149
|
-
([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
|
|
146
|
+
- Revert "chore: upgrade @apollo/client" ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
|
|
150
147
|
|
|
151
148
|
# [2.101.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql@2.100.10...@graphcommerce/graphql@2.101.0) (2021-07-26)
|
|
152
149
|
|
|
153
150
|
### Bug Fixes
|
|
154
151
|
|
|
155
|
-
- ignore md files from triggering version updates
|
|
156
|
-
([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
|
|
152
|
+
- ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
|
|
157
153
|
|
|
158
154
|
### Features
|
|
159
155
|
|
|
160
|
-
- **playwright:** added new playwright package to enable browser testing
|
|
161
|
-
([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
|
|
156
|
+
- **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
|
package/createCacheReviver.ts
CHANGED
|
@@ -7,6 +7,10 @@ import { getTypePoliciesVersion } from './typePolicies'
|
|
|
7
7
|
const APOLLO_CACHE_PERSIST = 'apollo-cache-persist'
|
|
8
8
|
const APOLLO_CACHE_VERSION = 'apollo-cache-version'
|
|
9
9
|
|
|
10
|
+
let persistor: CachePersistor<NormalizedCacheObject> | undefined
|
|
11
|
+
|
|
12
|
+
export const persistCache = () => persistor?.persist()
|
|
13
|
+
|
|
10
14
|
/** Revives the cache from the localStorage if it is available. */
|
|
11
15
|
export function createCacheReviver(
|
|
12
16
|
client: ApolloClient<NormalizedCacheObject>,
|
|
@@ -18,10 +22,12 @@ export function createCacheReviver(
|
|
|
18
22
|
let state = incommingState
|
|
19
23
|
const typePoliciesVersion = getTypePoliciesVersion(policies)
|
|
20
24
|
|
|
25
|
+
if (persistor) return
|
|
26
|
+
|
|
21
27
|
if (typeof window !== 'undefined') {
|
|
22
28
|
try {
|
|
23
29
|
const { cache } = client
|
|
24
|
-
|
|
30
|
+
persistor = new CachePersistor({
|
|
25
31
|
cache,
|
|
26
32
|
storage: new LocalStorageWrapper(window.localStorage),
|
|
27
33
|
maxSize: false,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/graphql",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.6",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "index.ts",
|
|
8
8
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
@@ -13,24 +13,24 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^4.
|
|
17
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.3",
|
|
17
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.5",
|
|
18
18
|
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
19
|
-
"@playwright/test": "^1.
|
|
19
|
+
"@playwright/test": "^1.20.1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@apollo/client": "^3.5.
|
|
23
|
-
"@graphcommerce/graphql-codegen-near-operation-file": "^3.0.
|
|
24
|
-
"@graphcommerce/graphql-codegen-relay-optimizer-plugin": "^3.0.
|
|
25
|
-
"@graphql-codegen/add": "
|
|
22
|
+
"@apollo/client": "^3.5.10",
|
|
23
|
+
"@graphcommerce/graphql-codegen-near-operation-file": "^3.0.9",
|
|
24
|
+
"@graphcommerce/graphql-codegen-relay-optimizer-plugin": "^3.0.6",
|
|
25
|
+
"@graphql-codegen/add": "3.1.1",
|
|
26
26
|
"@graphql-codegen/fragment-matcher": "3.2.1",
|
|
27
27
|
"@graphql-codegen/introspection": "2.1.1",
|
|
28
|
-
"@graphql-codegen/schema-ast": "
|
|
29
|
-
"@graphql-codegen/typed-document-node": "
|
|
30
|
-
"@graphql-codegen/typescript": "
|
|
31
|
-
"@graphql-codegen/typescript-apollo-client-helpers": "
|
|
32
|
-
"@graphql-codegen/typescript-document-nodes": "2.2.
|
|
33
|
-
"@graphql-codegen/typescript-operations": "2.3.
|
|
28
|
+
"@graphql-codegen/schema-ast": "2.4.1",
|
|
29
|
+
"@graphql-codegen/typed-document-node": "2.2.8",
|
|
30
|
+
"@graphql-codegen/typescript": "2.4.8",
|
|
31
|
+
"@graphql-codegen/typescript-apollo-client-helpers": "2.1.15",
|
|
32
|
+
"@graphql-codegen/typescript-document-nodes": "2.2.8",
|
|
33
|
+
"@graphql-codegen/typescript-operations": "2.3.5",
|
|
34
34
|
"apollo3-cache-persist": "^0.14.0",
|
|
35
35
|
"graphql": "^16.3.0"
|
|
36
36
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-empty-pattern */
|
|
2
|
-
import { getOperationName } from '@graphcommerce/graphql'
|
|
3
2
|
import { test as base, Page } from '@playwright/test'
|
|
4
3
|
import {
|
|
5
4
|
ApolloClient,
|
|
6
5
|
FetchResult,
|
|
6
|
+
getOperationName,
|
|
7
7
|
InMemoryCache,
|
|
8
8
|
NormalizedCacheObject,
|
|
9
9
|
TypedDocumentNode,
|
|
@@ -18,9 +18,15 @@ export async function waitForGraphQlResponse<Q, V>(
|
|
|
18
18
|
docOrName: string | TypedDocumentNode<Q, V>,
|
|
19
19
|
): Promise<FetchResult<Q>> {
|
|
20
20
|
const name = typeof docOrName === 'string' ? docOrName : getOperationName(docOrName)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
|
|
22
|
+
const response = await page.waitForResponse((r) => {
|
|
23
|
+
try {
|
|
24
|
+
return r.request().postDataJSON()?.operationName === name
|
|
25
|
+
} catch (e) {
|
|
26
|
+
return false
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
24
30
|
return (await response?.json()) as FetchResult<Q>
|
|
25
31
|
}
|
|
26
32
|
|