@graphcommerce/graphql-mesh 6.0.2-canary.2 → 6.0.2-canary.22
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 +46 -0
- package/customFetch.js +26 -6
- package/package.json +4 -4
- package/customFetch.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.0.2-canary.22
|
|
4
|
+
|
|
5
|
+
## 6.0.2-canary.21
|
|
6
|
+
|
|
7
|
+
## 6.0.2-canary.20
|
|
8
|
+
|
|
9
|
+
## 6.0.2-canary.19
|
|
10
|
+
|
|
11
|
+
## 6.0.2-canary.18
|
|
12
|
+
|
|
13
|
+
## 6.0.2-canary.17
|
|
14
|
+
|
|
15
|
+
## 6.0.2-canary.16
|
|
16
|
+
|
|
17
|
+
## 6.0.2-canary.15
|
|
18
|
+
|
|
19
|
+
## 6.0.2-canary.14
|
|
20
|
+
|
|
21
|
+
## 6.0.2-canary.13
|
|
22
|
+
|
|
23
|
+
## 6.0.2-canary.12
|
|
24
|
+
|
|
25
|
+
## 6.0.2-canary.11
|
|
26
|
+
|
|
27
|
+
## 6.0.2-canary.10
|
|
28
|
+
|
|
29
|
+
## 6.0.2-canary.9
|
|
30
|
+
|
|
31
|
+
## 6.0.2-canary.8
|
|
32
|
+
|
|
33
|
+
## 6.0.2-canary.7
|
|
34
|
+
|
|
35
|
+
## 6.0.2-canary.6
|
|
36
|
+
|
|
37
|
+
## 6.0.2-canary.5
|
|
38
|
+
|
|
39
|
+
## 6.0.2-canary.4
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [#1874](https://github.com/graphcommerce-org/graphcommerce/pull/1874) [`2a60491c2`](https://github.com/graphcommerce-org/graphcommerce/commit/2a60491c23a9cd0bfd79296d29f6c9ee31faada5) - The mesh wouldn't keep ssl handshakes alive causing an additional delay for each request. Solving this will improve every fetch request 30-100ms, depending on the ssl handshake performance of the server. ([@paales](https://github.com/paales))
|
|
44
|
+
|
|
45
|
+
- [#1874](https://github.com/graphcommerce-org/graphcommerce/pull/1874) [`2a60491c2`](https://github.com/graphcommerce-org/graphcommerce/commit/2a60491c23a9cd0bfd79296d29f6c9ee31faada5) - Magento couldn't respond with any cached Varnish responses because there was an empty authorization header sent with each request. ([@paales](https://github.com/paales))
|
|
46
|
+
|
|
47
|
+
## 6.0.2-canary.3
|
|
48
|
+
|
|
3
49
|
## 6.0.2-canary.2
|
|
4
50
|
|
|
5
51
|
## 6.0.2-canary.1
|
package/customFetch.js
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
3
|
const fetchRetry = require('fetch-retry')
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/** @type {fetchRetry.default} */
|
|
6
|
+
const fetcher = fetchRetry(
|
|
7
|
+
process.env.__NEXT_PROCESSED_ENV ? fetch : require('@whatwg-node/fetch').fetch,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {RequestInfo | URL} url
|
|
12
|
+
* @param {import('fetch-retry').RequestInitWithRetry | undefined} options
|
|
13
|
+
* @returns {Promise<Response>}
|
|
14
|
+
*/
|
|
15
|
+
module.exports = (url, options) => {
|
|
16
|
+
/** @type {RequestInit['headers']} */
|
|
17
|
+
const headers = Object.fromEntries(
|
|
18
|
+
Object.entries(options?.headers ?? {}).filter(([_, value]) => value !== ''),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
return fetcher(url, {
|
|
22
|
+
...options,
|
|
23
|
+
headers,
|
|
24
|
+
retries: 6,
|
|
25
|
+
retryDelay: (attempt) => 2 ** attempt * 200, // 200, 400, 800, 1600, 3200, 6400
|
|
26
|
+
retryOn: [429],
|
|
27
|
+
})
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/graphql-mesh",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.0.2-canary.
|
|
5
|
+
"version": "6.0.2-canary.22",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "index.ts",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"graphql": "16.6.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@graphcommerce/eslint-config-pwa": "6.0.2-canary.
|
|
26
|
-
"@graphcommerce/prettier-config-pwa": "6.0.2-canary.
|
|
27
|
-
"@graphcommerce/typescript-config-pwa": "6.0.2-canary.
|
|
25
|
+
"@graphcommerce/eslint-config-pwa": "6.0.2-canary.22",
|
|
26
|
+
"@graphcommerce/prettier-config-pwa": "6.0.2-canary.22",
|
|
27
|
+
"@graphcommerce/typescript-config-pwa": "6.0.2-canary.22",
|
|
28
28
|
"typescript": "4.9.5"
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
package/customFetch.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { fetch as fetchBase } from '@whatwg-node/fetch'
|
|
2
|
-
import fetchRetry, { RequestInitWithRetry } from 'fetch-retry'
|
|
3
|
-
|
|
4
|
-
type RetryOptions = Pick<RequestInitWithRetry, 'retries' | 'retryDelay' | 'retryOn'>
|
|
5
|
-
|
|
6
|
-
export default fetchRetry(fetchBase, {
|
|
7
|
-
retries: 6,
|
|
8
|
-
retryDelay: (attempt) => 2 ** attempt * 200, // 200, 400, 800, 1600, 3200, 6400
|
|
9
|
-
retryOn: [429],
|
|
10
|
-
} as RetryOptions)
|