@graphcommerce/graphql-mesh 7.1.0-canary.8 → 8.0.0-canary.100
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 +176 -0
- package/api/apolloLink.ts +13 -37
- package/package.json +10 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,181 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 8.0.0-canary.100
|
|
4
|
+
|
|
5
|
+
## 8.0.0-canary.99
|
|
6
|
+
|
|
7
|
+
## 8.0.0-canary.98
|
|
8
|
+
|
|
9
|
+
## 8.0.0-canary.97
|
|
10
|
+
|
|
11
|
+
## 8.0.0-canary.96
|
|
12
|
+
|
|
13
|
+
## 8.0.0-canary.95
|
|
14
|
+
|
|
15
|
+
## 8.0.0-canary.94
|
|
16
|
+
|
|
17
|
+
## 8.0.0-canary.93
|
|
18
|
+
|
|
19
|
+
## 8.0.0-canary.92
|
|
20
|
+
|
|
21
|
+
## 8.0.0-canary.91
|
|
22
|
+
|
|
23
|
+
## 8.0.0-canary.90
|
|
24
|
+
|
|
25
|
+
## 8.0.0-canary.89
|
|
26
|
+
|
|
27
|
+
## 8.0.0-canary.88
|
|
28
|
+
|
|
29
|
+
## 8.0.0-canary.87
|
|
30
|
+
|
|
31
|
+
## 8.0.0-canary.86
|
|
32
|
+
|
|
33
|
+
## 8.0.0-canary.85
|
|
34
|
+
|
|
35
|
+
## 8.0.0-canary.84
|
|
36
|
+
|
|
37
|
+
## 8.0.0-canary.83
|
|
38
|
+
|
|
39
|
+
## 8.0.0-canary.82
|
|
40
|
+
|
|
41
|
+
## 8.0.0-canary.81
|
|
42
|
+
|
|
43
|
+
## 8.0.0-canary.80
|
|
44
|
+
|
|
45
|
+
## 8.0.0-canary.79
|
|
46
|
+
|
|
47
|
+
## 8.0.0-canary.78
|
|
48
|
+
|
|
49
|
+
## 8.0.0-canary.77
|
|
50
|
+
|
|
51
|
+
## 8.0.0-canary.76
|
|
52
|
+
|
|
53
|
+
## 8.0.0-canary.75
|
|
54
|
+
|
|
55
|
+
## 8.0.0-canary.74
|
|
56
|
+
|
|
57
|
+
## 8.0.0-canary.73
|
|
58
|
+
|
|
59
|
+
## 8.0.0-canary.72
|
|
60
|
+
|
|
61
|
+
## 8.0.0-canary.71
|
|
62
|
+
|
|
63
|
+
## 8.0.0-canary.70
|
|
64
|
+
|
|
65
|
+
## 8.0.0-canary.69
|
|
66
|
+
|
|
67
|
+
## 7.1.0-canary.68
|
|
68
|
+
|
|
69
|
+
## 7.1.0-canary.67
|
|
70
|
+
|
|
71
|
+
## 7.1.0-canary.66
|
|
72
|
+
|
|
73
|
+
## 7.1.0-canary.65
|
|
74
|
+
|
|
75
|
+
## 7.1.0-canary.64
|
|
76
|
+
|
|
77
|
+
## 7.1.0-canary.63
|
|
78
|
+
|
|
79
|
+
## 7.1.0-canary.62
|
|
80
|
+
|
|
81
|
+
## 7.1.0-canary.61
|
|
82
|
+
|
|
83
|
+
## 7.1.0-canary.60
|
|
84
|
+
|
|
85
|
+
## 7.1.0-canary.59
|
|
86
|
+
|
|
87
|
+
## 7.1.0-canary.58
|
|
88
|
+
|
|
89
|
+
## 7.1.0-canary.57
|
|
90
|
+
|
|
91
|
+
## 7.1.0-canary.56
|
|
92
|
+
|
|
93
|
+
## 7.1.0-canary.55
|
|
94
|
+
|
|
95
|
+
## 7.1.0-canary.54
|
|
96
|
+
|
|
97
|
+
## 7.1.0-canary.53
|
|
98
|
+
|
|
99
|
+
## 7.1.0-canary.52
|
|
100
|
+
|
|
101
|
+
## 7.1.0-canary.51
|
|
102
|
+
|
|
103
|
+
## 7.1.0-canary.50
|
|
104
|
+
|
|
105
|
+
## 7.1.0-canary.49
|
|
106
|
+
|
|
107
|
+
## 7.1.0-canary.48
|
|
108
|
+
|
|
109
|
+
## 7.1.0-canary.47
|
|
110
|
+
|
|
111
|
+
## 7.1.0-canary.46
|
|
112
|
+
|
|
113
|
+
## 7.1.0-canary.45
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- [#2113](https://github.com/graphcommerce-org/graphcommerce/pull/2113) [`bf5ae8979`](https://github.com/graphcommerce-org/graphcommerce/commit/bf5ae8979b145e7a96303f839ef2b1238712531a) - Remove requirement of toplevelAwait for graphqlSsrClient and solve logging issue in cli ([@paales](https://github.com/paales))
|
|
118
|
+
|
|
119
|
+
## 7.1.0-canary.38
|
|
120
|
+
|
|
121
|
+
## 7.1.0-canary.37
|
|
122
|
+
|
|
123
|
+
## 7.1.0-canary.36
|
|
124
|
+
|
|
125
|
+
## 7.1.0-canary.35
|
|
126
|
+
|
|
127
|
+
## 7.1.0-canary.34
|
|
128
|
+
|
|
129
|
+
## 7.1.0-canary.33
|
|
130
|
+
|
|
131
|
+
## 7.1.0-canary.32
|
|
132
|
+
|
|
133
|
+
## 7.1.0-canary.31
|
|
134
|
+
|
|
135
|
+
## 7.1.0-canary.30
|
|
136
|
+
|
|
137
|
+
## 7.1.0-canary.29
|
|
138
|
+
|
|
139
|
+
## 7.1.0-canary.28
|
|
140
|
+
|
|
141
|
+
## 7.1.0-canary.27
|
|
142
|
+
|
|
143
|
+
## 7.1.0-canary.26
|
|
144
|
+
|
|
145
|
+
## 7.1.0-canary.25
|
|
146
|
+
|
|
147
|
+
## 7.1.0-canary.24
|
|
148
|
+
|
|
149
|
+
## 7.1.0-canary.23
|
|
150
|
+
|
|
151
|
+
## 7.1.0-canary.22
|
|
152
|
+
|
|
153
|
+
## 7.1.0-canary.21
|
|
154
|
+
|
|
155
|
+
## 7.1.0-canary.20
|
|
156
|
+
|
|
157
|
+
## 7.1.0-canary.19
|
|
158
|
+
|
|
159
|
+
## 7.1.0-canary.18
|
|
160
|
+
|
|
161
|
+
## 7.1.0-canary.17
|
|
162
|
+
|
|
163
|
+
## 7.1.0-canary.16
|
|
164
|
+
|
|
165
|
+
## 7.1.0-canary.15
|
|
166
|
+
|
|
167
|
+
## 7.1.0-canary.14
|
|
168
|
+
|
|
169
|
+
## 7.1.0-canary.13
|
|
170
|
+
|
|
171
|
+
## 7.1.0-canary.12
|
|
172
|
+
|
|
173
|
+
## 7.1.0-canary.11
|
|
174
|
+
|
|
175
|
+
## 7.1.0-canary.10
|
|
176
|
+
|
|
177
|
+
## 7.1.0-canary.9
|
|
178
|
+
|
|
3
179
|
## 7.1.0-canary.8
|
|
4
180
|
|
|
5
181
|
## 7.0.2-canary.7
|
package/api/apolloLink.ts
CHANGED
|
@@ -1,38 +1,19 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This is a direct copy from
|
|
5
|
-
* https://github.com/Urigo/graphql-mesh/blob/master/packages/apollo-link/src/index.ts but because
|
|
6
|
-
* it throws an error we've created a local copy of it.
|
|
7
|
-
*
|
|
8
|
-
* https://github.com/apollographql/apollo-client/issues/9925
|
|
9
|
-
* https://github.com/Urigo/graphql-mesh/issues/4196
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
1
|
import { ApolloLink, FetchResult, Observable, Operation, RequestHandler } from '@apollo/client/core'
|
|
13
|
-
import { ExecuteMeshFn, SubscribeMeshFn } from '@graphql-mesh/runtime'
|
|
2
|
+
import { ExecuteMeshFn, MeshInstance, SubscribeMeshFn } from '@graphql-mesh/runtime'
|
|
14
3
|
import { isAsyncIterable } from '@graphql-tools/utils'
|
|
15
|
-
import { getOperationAST } from 'graphql'
|
|
16
|
-
|
|
17
|
-
export interface MeshApolloRequestHandlerOptions {
|
|
18
|
-
execute: ExecuteMeshFn
|
|
19
|
-
subscribe?: SubscribeMeshFn
|
|
20
|
-
}
|
|
21
4
|
|
|
22
5
|
const ROOT_VALUE = {}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const operationFn =
|
|
30
|
-
operationAst.operation === 'subscription' && options.subscribe
|
|
31
|
-
? options.subscribe
|
|
32
|
-
: options.execute
|
|
33
|
-
return new Observable((observer) => {
|
|
6
|
+
|
|
7
|
+
function createMeshApolloRequestHandler(
|
|
8
|
+
mesh: MeshInstance | Promise<MeshInstance>,
|
|
9
|
+
): RequestHandler {
|
|
10
|
+
return (operation: Operation): Observable<FetchResult> =>
|
|
11
|
+
new Observable((observer) => {
|
|
34
12
|
Promise.resolve()
|
|
35
13
|
.then(async () => {
|
|
14
|
+
// Create a new executor for each request
|
|
15
|
+
const operationFn: SubscribeMeshFn | ExecuteMeshFn = (await mesh).createExecutor({})
|
|
16
|
+
|
|
36
17
|
const results = await operationFn(
|
|
37
18
|
operation.query,
|
|
38
19
|
operation.variables,
|
|
@@ -42,9 +23,7 @@ function createMeshApolloRequestHandler(options: MeshApolloRequestHandlerOptions
|
|
|
42
23
|
)
|
|
43
24
|
if (isAsyncIterable(results)) {
|
|
44
25
|
for await (const result of results) {
|
|
45
|
-
if (observer.closed)
|
|
46
|
-
return
|
|
47
|
-
}
|
|
26
|
+
if (observer.closed) return
|
|
48
27
|
observer.next(result)
|
|
49
28
|
}
|
|
50
29
|
observer.complete()
|
|
@@ -54,16 +33,13 @@ function createMeshApolloRequestHandler(options: MeshApolloRequestHandlerOptions
|
|
|
54
33
|
}
|
|
55
34
|
})
|
|
56
35
|
.catch((error) => {
|
|
57
|
-
if (!observer.closed)
|
|
58
|
-
observer.error(error)
|
|
59
|
-
}
|
|
36
|
+
if (!observer.closed) observer.error(error)
|
|
60
37
|
})
|
|
61
38
|
})
|
|
62
|
-
}
|
|
63
39
|
}
|
|
64
40
|
|
|
65
41
|
export class MeshApolloLink extends ApolloLink {
|
|
66
|
-
constructor(options:
|
|
42
|
+
constructor(options: MeshInstance | Promise<MeshInstance>) {
|
|
67
43
|
super(createMeshApolloRequestHandler(options))
|
|
68
44
|
}
|
|
69
45
|
}
|
package/package.json
CHANGED
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
"name": "@graphcommerce/graphql-mesh",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "
|
|
6
|
-
"author": "",
|
|
7
|
-
"license": "MIT",
|
|
5
|
+
"version": "8.0.0-canary.100",
|
|
8
6
|
"main": "index.ts",
|
|
9
7
|
"dependencies": {
|
|
10
|
-
"@apollo/client": "~3.8.2",
|
|
11
8
|
"@graphql-mesh/apollo-link": "latest",
|
|
12
9
|
"@graphql-mesh/config": "latest",
|
|
13
10
|
"@graphql-mesh/cross-helpers": "latest",
|
|
14
11
|
"@graphql-mesh/graphql": "latest",
|
|
12
|
+
"@graphql-mesh/http": "latest",
|
|
15
13
|
"@graphql-mesh/plugin-http-details-extensions": "latest",
|
|
16
14
|
"@graphql-mesh/runtime": "latest",
|
|
17
15
|
"@graphql-mesh/store": "latest",
|
|
@@ -19,19 +17,20 @@
|
|
|
19
17
|
"@graphql-mesh/transform-prune": "latest",
|
|
20
18
|
"@graphql-mesh/types": "latest",
|
|
21
19
|
"@graphql-mesh/utils": "latest",
|
|
22
|
-
"@graphql-tools/utils": "^10.0.
|
|
23
|
-
"@whatwg-node/fetch": "^0.9.
|
|
20
|
+
"@graphql-tools/utils": "^10.0.12",
|
|
21
|
+
"@whatwg-node/fetch": "^0.9.15",
|
|
24
22
|
"fetch-retry": "^5.0.6",
|
|
25
|
-
"tslib": "^2.
|
|
23
|
+
"tslib": "^2.6.2"
|
|
26
24
|
},
|
|
27
25
|
"peerDependencies": {
|
|
26
|
+
"@apollo/client": "^3",
|
|
27
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.0-canary.100",
|
|
28
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.0-canary.100",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.0-canary.100",
|
|
28
30
|
"graphql": "^16.7.1"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"
|
|
32
|
-
"@graphcommerce/prettier-config-pwa": "7.1.0-canary.8",
|
|
33
|
-
"@graphcommerce/typescript-config-pwa": "7.1.0-canary.8",
|
|
34
|
-
"typescript": "5.2.2"
|
|
33
|
+
"typescript": "5.3.3"
|
|
35
34
|
},
|
|
36
35
|
"sideEffects": false,
|
|
37
36
|
"prettier": "@graphcommerce/prettier-config-pwa",
|