@graphcommerce/algolia-recommend 9.0.0-canary.99 → 9.0.0

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,30 +1,52 @@
1
1
  # @graphcommerce/algolia-recommend
2
2
 
3
- ## 9.0.0-canary.99
3
+ ## 9.0.0
4
4
 
5
- ## 9.0.0-canary.98
5
+ ### Minor Changes
6
+
7
+ - [#2377](https://github.com/graphcommerce-org/graphcommerce/pull/2377) [`56fcc45`](https://github.com/graphcommerce-org/graphcommerce/commit/56fcc45b60e43574c64fcdd7b02f8062d677e250) - Integrated algolia recommend queries into graphql mesh. Provide accurate upsells and related products on pdp pages ([@Renzovh](https://github.com/Renzovh))
8
+
9
+ ### Patch Changes
10
+
11
+ - [#2385](https://github.com/graphcommerce-org/graphcommerce/pull/2385) [`44f18b5`](https://github.com/graphcommerce-org/graphcommerce/commit/44f18b5a8986935728f7147d6f506dd1376fd594) - Added support for Adobe Commerce for Algolia. ([@paales](https://github.com/paales))
12
+
13
+ - [#2379](https://github.com/graphcommerce-org/graphcommerce/pull/2379) [`ce30678`](https://github.com/graphcommerce-org/graphcommerce/commit/ce30678ad353ac4c7c38d79e96a2bb3de55f6fcb) - Automatically fall back to existing upsells/related products if they are defined and Algolia returns an error ([@paales](https://github.com/paales))
14
+
15
+ ## 9.0.0-canary.118
6
16
 
7
- ## 9.0.0-canary.97
17
+ ## 9.0.0-canary.117
8
18
 
9
- ## 9.0.0-canary.96
19
+ ## 9.0.0-canary.116
10
20
 
11
- ## 9.0.0-canary.95
21
+ ## 9.0.0-canary.115
12
22
 
13
- ## 9.0.0-canary.94
23
+ ## 9.0.0-canary.114
14
24
 
15
- ## 9.0.0-canary.93
25
+ ## 9.0.0-canary.113
16
26
 
17
- ## 9.0.0-canary.92
27
+ ## 9.0.0-canary.112
18
28
 
19
- ## 9.0.0-canary.91
29
+ ## 9.0.0-canary.111
20
30
 
21
- ## 9.0.0-canary.90
31
+ ## 9.0.0-canary.110
22
32
 
23
- ## 9.0.0-canary.89
33
+ ## 9.0.0-canary.109
24
34
 
25
- ## 9.0.0-canary.88
35
+ ## 9.0.0-canary.108
26
36
 
27
- ## 9.0.0-canary.87
37
+ ## 9.0.0-canary.107
38
+
39
+ ## 9.0.0-canary.106
40
+
41
+ ### Patch Changes
42
+
43
+ - [#2385](https://github.com/graphcommerce-org/graphcommerce/pull/2385) [`44f18b5`](https://github.com/graphcommerce-org/graphcommerce/commit/44f18b5a8986935728f7147d6f506dd1376fd594) - Added support for Adobe Commerce for Algolia. ([@paales](https://github.com/paales))
44
+
45
+ ## 9.0.0-canary.105
46
+
47
+ ## 9.0.0-canary.104
48
+
49
+ ## 9.0.0-canary.103
28
50
 
29
51
  ## 9.0.0-canary.86
30
52
 
@@ -32,8 +54,6 @@
32
54
 
33
55
  - [#2379](https://github.com/graphcommerce-org/graphcommerce/pull/2379) [`ce30678`](https://github.com/graphcommerce-org/graphcommerce/commit/ce30678ad353ac4c7c38d79e96a2bb3de55f6fcb) - Automatically fall back to existing upsells/related products if they are defined and Algolia returns an error ([@paales](https://github.com/paales))
34
56
 
35
- ## 9.0.0-canary.85
36
-
37
57
  ## 9.0.0-canary.84
38
58
 
39
59
  ### Minor Changes
@@ -2,9 +2,9 @@ import { algoliaHitToMagentoProduct } from '@graphcommerce/algolia-products'
2
2
  import { getGroupId } from '@graphcommerce/algolia-products/mesh/getGroupId'
3
3
  import { getStoreConfig } from '@graphcommerce/algolia-products/mesh/getStoreConfig'
4
4
  import type {
5
- MeshContext,
6
- AlgoliarecommendationsHit,
7
5
  Algoliahit,
6
+ AlgoliarecommendationsHit,
7
+ MeshContext,
8
8
  } from '@graphcommerce/graphql-mesh'
9
9
 
10
10
  export async function createProductMapper(context: MeshContext) {
@@ -1,11 +1,12 @@
1
1
  import { getSearchResultsInput } from '@graphcommerce/algolia-products'
2
- import {
3
- QueryproductsArgs,
4
- MeshContext,
5
- AlgoliasearchParamsObject_Input,
2
+ import type {
6
3
  AlgoliaLookingSimilarInput,
4
+ AlgoliasearchParamsObject_Input,
5
+ MeshContext,
6
+ QueryproductsArgs,
7
7
  } from '@graphcommerce/graphql-mesh'
8
8
 
9
+ /** @public */
9
10
  export async function getRecommendationQueryInput(
10
11
  args: QueryproductsArgs,
11
12
  context: MeshContext,
@@ -1,8 +1,8 @@
1
1
  import { getIndexName } from '@graphcommerce/algolia-products/mesh/getIndexName'
2
2
  import type {
3
+ AlgoliarecommendationsHit,
3
4
  AlgoliarecommendationsRequest_Input,
4
5
  MeshContext,
5
- AlgoliarecommendationsHit,
6
6
  } from '@graphcommerce/graphql-mesh'
7
7
  import { nonNullable } from '@graphcommerce/next-ui'
8
8
  import type { GraphQLError, GraphQLResolveInfo } from 'graphql'
@@ -84,7 +84,7 @@ export async function getRecommendations<
84
84
  )
85
85
  } catch (e) {
86
86
  if (isGraphQLError(e)) {
87
- console.log(
87
+ console.info(
88
88
  'There was an error retrieving Algolia Recommendations, make sure the recommendation models are created',
89
89
  e,
90
90
  )
package/mesh/resolvers.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable @typescript-eslint/require-await */
2
- import fragments from '@graphcommerce/graphql/generated/fragments.json'
3
2
  import type {
4
3
  AlgoliaLookingSimilarInput,
5
4
  AlgoliaRelatedProductsInput,
@@ -10,7 +9,8 @@ import type {
10
9
  ResolversParentTypes,
11
10
  ResolversTypes,
12
11
  } from '@graphcommerce/graphql-mesh'
13
- import {
12
+ import fragments from '@graphcommerce/graphql/generated/fragments.json'
13
+ import type {
14
14
  GraphCommerceAlgoliaRecommendationLocation,
15
15
  InputMaybe,
16
16
  Maybe,
@@ -106,7 +106,7 @@ if (isEnabled(import.meta.graphCommerce.algolia.relatedProducts)) {
106
106
  productInterfaceTypes.forEach((productType) => {
107
107
  if (!resolvers[productType]) resolvers[productType] = {}
108
108
  resolvers[productType][fieldName] = {
109
- selectionSet: `{ uid }`,
109
+ selectionSet: '{ uid }',
110
110
  resolve,
111
111
  }
112
112
  })
@@ -131,7 +131,7 @@ if (isEnabled(import.meta.graphCommerce.algolia.lookingSimilar)) {
131
131
  productInterfaceTypes.forEach((productType) => {
132
132
  if (!resolvers[productType]) resolvers[productType] = {}
133
133
  resolvers[productType][fieldName] = {
134
- selectionSet: `{ uid }`,
134
+ selectionSet: '{ uid }',
135
135
  resolve,
136
136
  }
137
137
  })
@@ -156,7 +156,7 @@ if (isEnabled(import.meta.graphCommerce.algolia.frequentlyBoughtTogether)) {
156
156
 
157
157
  productInterfaceTypes.forEach((productType) => {
158
158
  if (!resolvers[productType]) resolvers[productType] = {}
159
- resolvers[productType][fieldName] = { selectionSet: `{ uid }`, resolve }
159
+ resolvers[productType][fieldName] = { selectionSet: '{ uid }', resolve }
160
160
  })
161
161
  }
162
162
 
@@ -230,12 +230,12 @@ const together: ResolverFn<
230
230
  productInterfaceTypes.forEach((productType) => {
231
231
  if (!resolvers[productType]) resolvers[productType] = {}
232
232
 
233
- resolvers[productType].algolia_looking_similar = { selectionSet: `{ uid }`, resolve: similar }
233
+ resolvers[productType].algolia_looking_similar = { selectionSet: '{ uid }', resolve: similar }
234
234
 
235
- resolvers[productType].algolia_related_products = { selectionSet: `{ uid }`, resolve: related }
235
+ resolvers[productType].algolia_related_products = { selectionSet: '{ uid }', resolve: related }
236
236
 
237
237
  resolvers[productType].algolia_frequently_bought_together = {
238
- selectionSet: `{ uid }`,
238
+ selectionSet: '{ uid }',
239
239
  resolve: together,
240
240
  }
241
241
  })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/algolia-recommend",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.0-canary.99",
5
+ "version": "9.0.0",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,15 +15,15 @@
15
15
  "generate": "tsx scripts/generate-recommend-spec.mts"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/algolia-products": "^9.0.0-canary.99",
19
- "@graphcommerce/graphql": "^9.0.0-canary.99",
20
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.99",
21
- "@graphcommerce/next-config": "^9.0.0-canary.99",
22
- "@graphcommerce/next-ui": "^9.0.0-canary.99",
18
+ "@graphcommerce/algolia-products": "^9.0.0",
19
+ "@graphcommerce/graphql": "^9.0.0",
20
+ "@graphcommerce/graphql-mesh": "^9.0.0",
21
+ "@graphcommerce/next-config": "^9.0.0",
22
+ "@graphcommerce/next-ui": "^9.0.0",
23
23
  "react": "^18.2.0"
24
24
  },
25
25
  "devDependencies": {
26
- "graphql": "^16.0.0",
27
- "tsx": "^4.16.2"
26
+ "graphql": "^16.10.0",
27
+ "tsx": "^4.19.2"
28
28
  }
29
29
  }
@@ -0,0 +1,7 @@
1
+ type GiftCardProduct implements ProductInterface {
2
+ algolia_looking_similar(input: AlgoliaLookingSimilarInput): [ProductInterface]
3
+ algolia_frequently_bought_together(
4
+ input: AlgoliaFrequentlyBoughtTogetherInput
5
+ ): [ProductInterface]
6
+ algolia_related_products(input: AlgoliaRelatedProductsInput): [ProductInterface]
7
+ }