@graphcommerce/magento-graphql-rest 9.1.0-canary.26 → 9.1.0-canary.29
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 +10 -0
- package/mesh/resolvers.ts +21 -0
- package/package.json +6 -6
- package/plugins/meshConfigM2Rest.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @graphcommerce/magento-graphql-rest
|
|
2
2
|
|
|
3
|
+
## 9.1.0-canary.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2525](https://github.com/graphcommerce-org/graphcommerce/pull/2525) [`4f9ddb8`](https://github.com/graphcommerce-org/graphcommerce/commit/4f9ddb820494a89a6ae37df6e2befa59910330b4) - Moved Customer group_id resolver to magento-graphql-rest package where it should belong. ([@paales](https://github.com/paales))
|
|
8
|
+
|
|
9
|
+
## 9.1.0-canary.28
|
|
10
|
+
|
|
11
|
+
## 9.1.0-canary.27
|
|
12
|
+
|
|
3
13
|
## 9.1.0-canary.26
|
|
4
14
|
|
|
5
15
|
## 9.1.0-canary.25
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MeshContext, Resolvers } from '@graphcommerce/graphql-mesh'
|
|
2
|
+
|
|
3
|
+
export const resolvers: Resolvers = {
|
|
4
|
+
Customer: {
|
|
5
|
+
group_id: {
|
|
6
|
+
resolve: async (root, args, context, info) => {
|
|
7
|
+
const { headers } = context as MeshContext & {
|
|
8
|
+
headers?: Record<string, string | undefined>
|
|
9
|
+
}
|
|
10
|
+
if (!headers?.authorization) return 0
|
|
11
|
+
const customer = await context.m2rest.Query.m2rest_GetV1CustomersMe({
|
|
12
|
+
root,
|
|
13
|
+
context,
|
|
14
|
+
info,
|
|
15
|
+
autoSelectionSetWithDepth: 10,
|
|
16
|
+
})
|
|
17
|
+
return customer?.group_id ?? null
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-graphql-rest",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.1.0-canary.
|
|
5
|
+
"version": "9.1.0-canary.29",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "index.ts",
|
|
8
8
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"generate": "tsx ./scripts/generate-spec.mts"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@graphcommerce/graphql-mesh": "^9.1.0-canary.
|
|
20
|
-
"@graphcommerce/magento-product": "^9.1.0-canary.
|
|
21
|
-
"@graphcommerce/magento-search": "^9.1.0-canary.
|
|
22
|
-
"@graphcommerce/next-config": "^9.1.0-canary.
|
|
23
|
-
"@graphcommerce/next-ui": "^9.1.0-canary.
|
|
19
|
+
"@graphcommerce/graphql-mesh": "^9.1.0-canary.29",
|
|
20
|
+
"@graphcommerce/magento-product": "^9.1.0-canary.29",
|
|
21
|
+
"@graphcommerce/magento-search": "^9.1.0-canary.29",
|
|
22
|
+
"@graphcommerce/next-config": "^9.1.0-canary.29",
|
|
23
|
+
"@graphcommerce/next-ui": "^9.1.0-canary.29",
|
|
24
24
|
"graphql": "^16.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -57,6 +57,10 @@ export const meshConfig: FunctionPlugin<typeof meshConfigBase> = (
|
|
|
57
57
|
],
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
|
+
additionalResolvers: [
|
|
61
|
+
...(baseConfig.additionalResolvers ?? []),
|
|
62
|
+
'@graphcommerce/magento-graphql-rest/mesh/resolvers.ts',
|
|
63
|
+
],
|
|
60
64
|
},
|
|
61
65
|
graphCommerceConfig,
|
|
62
66
|
)
|