@graphcommerce/graphql-mesh 5.1.0-canary.2 → 5.1.0-canary.3
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 +13 -0
- package/api/apolloLink.ts +0 -2
- package/api/createEnvelop.ts +7 -26
- package/customFetch.ts +10 -0
- package/package.json +19 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 5.1.0-canary.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1752](https://github.com/graphcommerce-org/graphcommerce/pull/1752) [`188f23452`](https://github.com/graphcommerce-org/graphcommerce/commit/188f2345255aacd7665d8e443cf42e20a3070a01) - Implement a custom fetch that has an exponential backoff so that build don’t fail as often ([@paales](https://github.com/paales))
|
|
8
|
+
|
|
9
|
+
- [#1752](https://github.com/graphcommerce-org/graphcommerce/pull/1752) [`2a6a4d9ec`](https://github.com/graphcommerce-org/graphcommerce/commit/2a6a4d9ecfa1b58a66ba9b9d00016d6feda9aa95) - Updated dependencies to latest versions, except for nextjs; Solve tons of peer dependency issues.
|
|
10
|
+
|
|
11
|
+
- Updated the @mui/material package
|
|
12
|
+
- Removed dependencies on react-hook-form-mui and @playwright/test
|
|
13
|
+
- Upgraded dependencies including type-fest and graphql-mesh
|
|
14
|
+
- Solved peer dependency issues ([@paales](https://github.com/paales))
|
|
15
|
+
|
|
3
16
|
## 5.1.0-canary.2
|
|
4
17
|
|
|
5
18
|
## 5.1.0-canary.1
|
package/api/apolloLink.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* https://github.com/Urigo/graphql-mesh/issues/4196
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
// export * from '@graphql-mesh/apollo-link'
|
|
13
12
|
import { ApolloLink, FetchResult, Observable, Operation, RequestHandler } from '@apollo/client/core'
|
|
14
13
|
import { ExecuteMeshFn, SubscribeMeshFn } from '@graphql-mesh/runtime'
|
|
15
14
|
import { isAsyncIterable } from '@graphql-tools/utils'
|
|
@@ -31,7 +30,6 @@ function createMeshApolloRequestHandler(options: MeshApolloRequestHandlerOptions
|
|
|
31
30
|
operationAst.operation === 'subscription' && options.subscribe
|
|
32
31
|
? options.subscribe
|
|
33
32
|
: options.execute
|
|
34
|
-
|
|
35
33
|
return new Observable((observer) => {
|
|
36
34
|
Promise.resolve()
|
|
37
35
|
.then(async () => {
|
package/api/createEnvelop.ts
CHANGED
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
-
import { useApolloTracing } from '@envelop/apollo-tracing'
|
|
3
|
-
import { createServer as createYogaServer } from '@graphql-yoga/node'
|
|
4
1
|
import { NextApiRequest, NextApiResponse } from 'next'
|
|
5
|
-
import {
|
|
2
|
+
import { createBuiltMeshHTTPHandler } from '../.mesh'
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
// retrieve the mesh instance (with configured Envelop plugins)
|
|
9
|
-
const mesh = await getBuiltMesh()
|
|
4
|
+
const handler = createBuiltMeshHTTPHandler()
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
res: NextApiResponse
|
|
17
|
-
}>({
|
|
18
|
-
plugins: [...mesh.plugins, useApolloTracing()],
|
|
19
|
-
context: ({ req }) => ({ ...req, ...mesh.meshContext }),
|
|
20
|
-
graphiql: {
|
|
21
|
-
endpoint,
|
|
22
|
-
title: playgroundTitle,
|
|
23
|
-
},
|
|
24
|
-
maskedErrors: false,
|
|
25
|
-
parserCache: false,
|
|
26
|
-
validationCache: false,
|
|
27
|
-
logging: mesh.logger,
|
|
28
|
-
cors,
|
|
29
|
-
})
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
7
|
+
export const createServer = async (endpoint: string) => {
|
|
8
|
+
if (endpoint !== '/api/graphql')
|
|
9
|
+
throw Error('Moving the GraphQL Endpoint is not supported at the moment')
|
|
10
|
+
return (req: NextApiRequest, res: NextApiResponse) => handler(req, res)
|
|
30
11
|
}
|
package/customFetch.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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)
|
package/package.json
CHANGED
|
@@ -2,28 +2,32 @@
|
|
|
2
2
|
"name": "@graphcommerce/graphql-mesh",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "5.1.0-canary.
|
|
5
|
+
"version": "5.1.0-canary.3",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "index.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@
|
|
11
|
-
"@graphql-mesh/apollo-link": "^
|
|
12
|
-
"@graphql-mesh/config": "
|
|
13
|
-
"@graphql-mesh/graphql": "0.
|
|
14
|
-
"@graphql-mesh/
|
|
15
|
-
"@graphql-mesh/
|
|
16
|
-
"@graphql-mesh/
|
|
17
|
-
"@graphql-
|
|
18
|
-
"
|
|
10
|
+
"@apollo/client": "^3.7.1",
|
|
11
|
+
"@graphql-mesh/apollo-link": "^8.0.7",
|
|
12
|
+
"@graphql-mesh/config": "8.0.36",
|
|
13
|
+
"@graphql-mesh/graphql": "0.32.4",
|
|
14
|
+
"@graphql-mesh/runtime": "^0.44.37",
|
|
15
|
+
"@graphql-mesh/transform-filter-schema": "0.14.115",
|
|
16
|
+
"@graphql-mesh/types": "0.87.1",
|
|
17
|
+
"@graphql-mesh/utils": "0.42.9",
|
|
18
|
+
"@whatwg-node/fetch": "^0.5.3",
|
|
19
|
+
"fetch-retry": "^5.0.3",
|
|
20
|
+
"graphql": "16.6.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"graphql": "^16.0.0",
|
|
19
24
|
"next": "12.2.5"
|
|
20
25
|
},
|
|
21
26
|
"devDependencies": {
|
|
22
|
-
"@graphcommerce/eslint-config-pwa": "
|
|
23
|
-
"@graphcommerce/prettier-config-pwa": "
|
|
24
|
-
"@graphcommerce/typescript-config-pwa": "
|
|
25
|
-
"
|
|
26
|
-
"typescript": "4.7.4"
|
|
27
|
+
"@graphcommerce/eslint-config-pwa": "5.1.0-canary.3",
|
|
28
|
+
"@graphcommerce/prettier-config-pwa": "5.1.0-canary.3",
|
|
29
|
+
"@graphcommerce/typescript-config-pwa": "5.1.0-canary.3",
|
|
30
|
+
"typescript": "4.9.3"
|
|
27
31
|
},
|
|
28
32
|
"sideEffects": false,
|
|
29
33
|
"prettier": "@graphcommerce/prettier-config-pwa",
|