@graphcommerce/graphql-mesh 3.1.0 → 3.2.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 +17 -0
- package/{createHandler.ts → createServer.ts} +7 -23
- package/index.ts +1 -2
- package/package.json +20 -14
- package/createTabs.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.2.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql-mesh@3.1.0...@graphcommerce/graphql-mesh@3.2.0) (2021-10-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **graphql-mesh:** use a build mesh for production environments ([cd2f318](https://github.com/ho-nl/m2-pwa/commit/cd2f3189383fa9d304bd367334e3f47ca4aa6100))
|
|
12
|
+
* unable to find cache matching inmemoryLru ([520f6f3](https://github.com/ho-nl/m2-pwa/commit/520f6f329573471ecfdbdc4aa6f2e4b688b31f11))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **graphql-mesh:** remove the api project and use a single project 🎉👩👩👦👦 ([ea4ad03](https://github.com/ho-nl/m2-pwa/commit/ea4ad0397d4ff289ef3b3253593fb0914c8c5246))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [3.1.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/graphql-mesh@3.0.11...@graphcommerce/graphql-mesh@3.1.0) (2021-10-20)
|
|
7
24
|
|
|
8
25
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { processConfig } from '@graphql-mesh/config'
|
|
2
2
|
import { getMesh as getGraphQLMesh, MeshInstance } from '@graphql-mesh/runtime'
|
|
3
|
-
import { MeshStore, InMemoryStoreStorageAdapter } from '@graphql-mesh/store'
|
|
4
3
|
import { YamlConfig } from '@graphql-mesh/types'
|
|
5
4
|
import { ApolloServerPluginLandingPageGraphQLPlayground } from 'apollo-server-core'
|
|
6
5
|
import { ApolloServer } from 'apollo-server-micro'
|
|
@@ -9,11 +8,17 @@ import '@graphql-mesh/graphql'
|
|
|
9
8
|
import '@graphql-mesh/merger-stitching'
|
|
10
9
|
import '@graphql-mesh/transform-cache'
|
|
11
10
|
import '@graphql-mesh/cache-inmemory-lru'
|
|
11
|
+
import '@vue/compiler-sfc'
|
|
12
12
|
import 'ts-tiny-invariant'
|
|
13
13
|
import 'micro'
|
|
14
14
|
import cors from 'micro-cors'
|
|
15
15
|
|
|
16
|
-
export async function
|
|
16
|
+
export async function getMesh(config: unknown): Promise<MeshInstance> {
|
|
17
|
+
return getGraphQLMesh(await processConfig(config as YamlConfig.Config, { dir: process.cwd() }))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function createServer(mesh: Promise<MeshInstance>, path: string) {
|
|
21
|
+
const meshInstance = await mesh
|
|
17
22
|
const apolloServer = new ApolloServer({
|
|
18
23
|
context: ({ req }) => req,
|
|
19
24
|
introspection: true,
|
|
@@ -29,27 +34,6 @@ export async function createApolloHandlerForMesh(meshInstance: MeshInstance, pat
|
|
|
29
34
|
|
|
30
35
|
const apolloHandler = apolloServer.createHandler({ path })
|
|
31
36
|
|
|
32
|
-
return apolloHandler
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export async function getMesh(config: YamlConfig.Config): Promise<MeshInstance> {
|
|
36
|
-
const store = new MeshStore('.mesh', new InMemoryStoreStorageAdapter(), {
|
|
37
|
-
validate: true,
|
|
38
|
-
readonly: false,
|
|
39
|
-
})
|
|
40
|
-
return getGraphQLMesh(await processConfig(config, { dir: process.cwd(), store }))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function createServer(config: unknown, path: string) {
|
|
44
|
-
const meshConfig = config as YamlConfig.Config
|
|
45
|
-
|
|
46
|
-
const store = new MeshStore('.mesh', new InMemoryStoreStorageAdapter(), {
|
|
47
|
-
validate: true,
|
|
48
|
-
readonly: false,
|
|
49
|
-
})
|
|
50
|
-
const mesh = await getGraphQLMesh(await processConfig(meshConfig, { dir: process.cwd(), store }))
|
|
51
|
-
const apolloHandler = await createApolloHandlerForMesh(mesh, path)
|
|
52
|
-
|
|
53
37
|
const corsHandler = cors({
|
|
54
38
|
allowMethods: ['GET', 'POST', 'OPTIONS'],
|
|
55
39
|
allowHeaders: [
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/graphql-mesh",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"author": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -9,30 +9,36 @@
|
|
|
9
9
|
"start": "next start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@graphql-mesh/cache-inmemory-lru": "^0.5.
|
|
13
|
-
"@graphql-mesh/cli": "^0.42.
|
|
14
|
-
"@graphql-mesh/config": "^0.24.
|
|
15
|
-
"@graphql-mesh/graphql": "^0.
|
|
16
|
-
"@graphql-mesh/merger-stitching": "^0.13.
|
|
17
|
-
"@graphql-mesh/runtime": "^0.
|
|
18
|
-
"@graphql-mesh/store": "^0.1.
|
|
19
|
-
"@graphql-mesh/transform-cache": "^0.9.
|
|
20
|
-
"@graphql-mesh/transform-federation": "^0.6.
|
|
21
|
-
"@graphql-mesh/transform-filter-schema": "^0.12.
|
|
12
|
+
"@graphql-mesh/cache-inmemory-lru": "^0.5.25",
|
|
13
|
+
"@graphql-mesh/cli": "^0.42.6",
|
|
14
|
+
"@graphql-mesh/config": "^0.24.4",
|
|
15
|
+
"@graphql-mesh/graphql": "^0.19.0",
|
|
16
|
+
"@graphql-mesh/merger-stitching": "^0.13.2",
|
|
17
|
+
"@graphql-mesh/runtime": "^0.24.1",
|
|
18
|
+
"@graphql-mesh/store": "^0.1.19",
|
|
19
|
+
"@graphql-mesh/transform-cache": "^0.9.21",
|
|
20
|
+
"@graphql-mesh/transform-federation": "^0.6.11",
|
|
21
|
+
"@graphql-mesh/transform-filter-schema": "^0.12.2",
|
|
22
22
|
"@graphql-mesh/types": "^0.53.0",
|
|
23
|
+
"@graphql-mesh/utils": "^0.19.0",
|
|
24
|
+
"@graphql-tools/utils": "^8.5.1",
|
|
25
|
+
"@vue/compiler-sfc": "^3.2.20",
|
|
23
26
|
"apollo-server-core": "^3.4.0",
|
|
24
27
|
"apollo-server-micro": "^3.4.0",
|
|
28
|
+
"camel-case": "^4.1.2",
|
|
29
|
+
"fetchache": "^0.1.1",
|
|
25
30
|
"graphql": "^15.6.1",
|
|
26
31
|
"micro": "^9.3.4",
|
|
27
32
|
"micro-cors": "^0.1.1",
|
|
33
|
+
"pascal-case": "^3.1.2",
|
|
28
34
|
"ts-tiny-invariant": "^0.0.3"
|
|
29
35
|
},
|
|
30
36
|
"devDependencies": {
|
|
31
37
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
32
|
-
"@graphcommerce/eslint-config-pwa": "^3.
|
|
38
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.3",
|
|
33
39
|
"@graphcommerce/prettier-config-pwa": "^3.0.3",
|
|
34
40
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
35
|
-
"@playwright/test": "^1.
|
|
41
|
+
"@playwright/test": "^1.16.2",
|
|
36
42
|
"@types/micro-cors": "^0.1.2",
|
|
37
43
|
"graphql-tag": "2.12.5",
|
|
38
44
|
"typescript": "^4.4.4"
|
|
@@ -51,5 +57,5 @@
|
|
|
51
57
|
"project": "./tsconfig.json"
|
|
52
58
|
}
|
|
53
59
|
},
|
|
54
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "b6321b8f479a0ef6e4b1b543702158d964bbeac6"
|
|
55
61
|
}
|
package/createTabs.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DocumentNode, print } from 'graphql'
|
|
2
|
-
|
|
3
|
-
export function createTabs(queries: DocumentNode[], endpoint: string) {
|
|
4
|
-
return Object.entries(queries)
|
|
5
|
-
.filter(([name]) => name.endsWith('Document'))
|
|
6
|
-
.map(([name, gql]) => ({
|
|
7
|
-
name: name.replace('Document', ''),
|
|
8
|
-
query: print(gql),
|
|
9
|
-
endpoint,
|
|
10
|
-
}))
|
|
11
|
-
.filter(({ query }) => query.includes('@client') === false)
|
|
12
|
-
}
|