@graphcommerce/algolia-recommend 9.1.0-canary.18 → 9.1.0-canary.20

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,15 @@
1
1
  # @graphcommerce/algolia-recommend
2
2
 
3
+ ## 9.1.0-canary.20
4
+
5
+ ## 9.1.0-canary.19
6
+
7
+ ### Patch Changes
8
+
9
+ - [#2499](https://github.com/graphcommerce-org/graphcommerce/pull/2499) [`32b65d6`](https://github.com/graphcommerce-org/graphcommerce/commit/32b65d6a805b84423f77bfbfe80ee3331da70718) - Make facetName and facetValue optional when retrieving trending products ([@paales](https://github.com/paales))
10
+
11
+ - [#2499](https://github.com/graphcommerce-org/graphcommerce/pull/2499) [`48d8922`](https://github.com/graphcommerce-org/graphcommerce/commit/48d892236c8fc41e058013b6d4ab98b76fb47fca) - Solve issue where trendingProducts or trendingFacetValues couldn’t be resolved becasue root would be null ([@paales](https://github.com/paales))
12
+
3
13
  ## 9.1.0-canary.18
4
14
 
5
15
  ## 9.1.0-canary.17
package/mesh/resolvers.ts CHANGED
@@ -25,7 +25,7 @@ const productInterfaceTypes = fragments.possibleTypes.ProductInterface as Produc
25
25
 
26
26
  const resolvers: Resolvers = {
27
27
  Query: {
28
- trendingProducts: async (root, args, context, info) => {
28
+ trendingProducts: async (root = {}, args, context, info) => {
29
29
  const { facetName, facetValue } = args.input
30
30
  const { threshold, fallbackParameters, maxRecommendations, queryParameters } =
31
31
  await getRecommendationsArgs(root, args, context)
@@ -45,7 +45,7 @@ const resolvers: Resolvers = {
45
45
  await createProductMapper(context),
46
46
  )
47
47
  },
48
- trendingFacetValues: async (root, args, context, info) => {
48
+ trendingFacetValues: async (root = {}, args, context, info) => {
49
49
  const { threshold, fallbackParameters, maxRecommendations, queryParameters } =
50
50
  await getRecommendationsArgs(root, args, context)
51
51
  return getRecommendations(
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.1.0-canary.18",
5
+ "version": "9.1.0-canary.20",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,11 +15,11 @@
15
15
  "generate": "tsx scripts/generate-recommend-spec.mts"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/algolia-products": "^9.1.0-canary.18",
19
- "@graphcommerce/graphql": "^9.1.0-canary.18",
20
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.18",
21
- "@graphcommerce/next-config": "^9.1.0-canary.18",
22
- "@graphcommerce/next-ui": "^9.1.0-canary.18",
18
+ "@graphcommerce/algolia-products": "^9.1.0-canary.20",
19
+ "@graphcommerce/graphql": "^9.1.0-canary.20",
20
+ "@graphcommerce/graphql-mesh": "^9.1.0-canary.20",
21
+ "@graphcommerce/next-config": "^9.1.0-canary.20",
22
+ "@graphcommerce/next-ui": "^9.1.0-canary.20",
23
23
  "react": "^18.2.0"
24
24
  },
25
25
  "devDependencies": {
@@ -14,6 +14,9 @@ input AlgoliaFallbackParams {
14
14
  }
15
15
 
16
16
  input AlgoliaLookingSimilarInput {
17
+ """
18
+ The maximum number of recommendations to return.
19
+ """
17
20
  maxRecommendations: Int = 8
18
21
 
19
22
  """
@@ -38,6 +41,9 @@ input AlgoliaLookingSimilarInput {
38
41
  }
39
42
 
40
43
  input AlgoliaFrequentlyBoughtTogetherInput {
44
+ """
45
+ The maximum number of recommendations to return.
46
+ """
41
47
  maxRecommendations: Int = 8
42
48
 
43
49
  """
@@ -57,6 +63,9 @@ input AlgoliaFrequentlyBoughtTogetherInput {
57
63
  }
58
64
 
59
65
  input AlgoliaRelatedProductsInput {
66
+ """
67
+ The maximum number of recommendations to return.
68
+ """
60
69
  maxRecommendations: Int = 8
61
70
 
62
71
  """
@@ -1,4 +1,7 @@
1
1
  input TrendingProductsInput {
2
+ """
3
+ The maximum number of recommendations to return.
4
+ """
2
5
  maxRecommendations: Int = 8
3
6
 
4
7
  """
@@ -10,13 +13,13 @@ input TrendingProductsInput {
10
13
  Facet attribute. To be used in combination with `facetValue`.
11
14
  If specified, only recommendations matching the facet filter will be returned.
12
15
  """
13
- facetName: String!
16
+ facetName: String
14
17
 
15
18
  """
16
19
  Facet value. To be used in combination with `facetName`.
17
20
  If specified, only recommendations matching the facet filter will be returned.
18
21
  """
19
- facetValue: String!
22
+ facetValue: String
20
23
 
21
24
  """
22
25
  One or more keywords to use in a full-text search.
@@ -35,6 +38,9 @@ input TrendingProductsInput {
35
38
  }
36
39
 
37
40
  input TrendingFacetValuesInput {
41
+ """
42
+ The maximum number of recommendations to return.
43
+ """
38
44
  maxRecommendations: Int = 8
39
45
 
40
46
  """