@graphcommerce/algolia-products 9.0.4-canary.9 → 9.1.0-canary.16

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @graphcommerce/algolia-products
2
2
 
3
+ ## 9.1.0-canary.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2494](https://github.com/graphcommerce-org/graphcommerce/pull/2494) [`fd824d4`](https://github.com/graphcommerce-org/graphcommerce/commit/fd824d41674d92a42bb7f354214d2b367a7beac2) - Solve issue when creating an account the group_id would be requested but there wansn't a token available to retrieve the group_id. ([@Renzovh](https://github.com/Renzovh))
8
+
9
+ ## 9.1.0-canary.15
10
+
11
+ ## 9.0.4-canary.14
12
+
13
+ ## 9.0.4-canary.13
14
+
15
+ ## 9.0.4-canary.12
16
+
17
+ ## 9.0.4-canary.11
18
+
19
+ ## 9.0.4-canary.10
20
+
3
21
  ## 9.0.4-canary.9
4
22
 
5
23
  ## 9.0.4-canary.8
package/mesh/resolvers.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AlgoliasearchResponse, Resolvers } from '@graphcommerce/graphql-mesh'
1
+ import type { AlgoliasearchResponse, MeshContext, Resolvers } from '@graphcommerce/graphql-mesh'
2
2
  import { hasSelectionSetPath } from '@graphcommerce/graphql-mesh'
3
3
  import type { GraphQLError, GraphQLResolveInfo } from 'graphql'
4
4
  import { algoliaFacetsToAggregations, getCategoryList } from './algoliaFacetsToAggregations'
@@ -97,6 +97,23 @@ export const resolvers: Resolvers = {
97
97
  return items
98
98
  },
99
99
  },
100
+ Customer: {
101
+ group_id: {
102
+ resolve: async (root, args, context, info) => {
103
+ const { headers } = context as MeshContext & {
104
+ headers?: Record<string, string | undefined>
105
+ }
106
+ if (!headers?.authorization) return 0
107
+ const customer = await context.m2rest.Query.m2rest_GetV1CustomersMe({
108
+ root,
109
+ context,
110
+ info,
111
+ autoSelectionSetWithDepth: 10,
112
+ })
113
+ return customer?.group_id ?? null
114
+ },
115
+ },
116
+ },
100
117
  Query: {
101
118
  products: async (root, args, context, info) => {
102
119
  const isAgolia = (args.filter?.engine?.in ?? [args.filter?.engine?.eq])[0] === 'algolia'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/algolia-products",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.4-canary.9",
5
+ "version": "9.1.0-canary.16",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,14 +15,14 @@
15
15
  "generate": "tsx scripts/generate-spec.mts"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/google-datalayer": "^9.0.4-canary.9",
19
- "@graphcommerce/graphql": "^9.0.4-canary.9",
20
- "@graphcommerce/graphql-mesh": "^9.0.4-canary.9",
21
- "@graphcommerce/magento-customer": "^9.0.4-canary.9",
22
- "@graphcommerce/magento-product": "^9.0.4-canary.9",
23
- "@graphcommerce/magento-search": "^9.0.4-canary.9",
24
- "@graphcommerce/next-config": "^9.0.4-canary.9",
25
- "@graphcommerce/next-ui": "^9.0.4-canary.9",
18
+ "@graphcommerce/google-datalayer": "^9.1.0-canary.16",
19
+ "@graphcommerce/graphql": "^9.1.0-canary.16",
20
+ "@graphcommerce/graphql-mesh": "^9.1.0-canary.16",
21
+ "@graphcommerce/magento-customer": "^9.1.0-canary.16",
22
+ "@graphcommerce/magento-product": "^9.1.0-canary.16",
23
+ "@graphcommerce/magento-search": "^9.1.0-canary.16",
24
+ "@graphcommerce/next-config": "^9.1.0-canary.16",
25
+ "@graphcommerce/next-ui": "^9.1.0-canary.16",
26
26
  "react": "^18.2.0"
27
27
  },
28
28
  "devDependencies": {
@@ -1,9 +0,0 @@
1
- type Customer {
2
- group_id: Int
3
- @resolveTo(
4
- sourceName: "m2rest"
5
- sourceTypeName: "Query"
6
- sourceFieldName: "m2rest_GetV1CustomersMe"
7
- result: "group_id"
8
- )
9
- }