diff --git a/CHANGELOG.md b/CHANGELOG.md
index 021d5f5..c5fcd7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
+### Added
+- `groupByProduct` to `productRecommendations` query.
+- `quantity` to `Recommendation.similars` resolver.
+-
## [0.58.0] - 2023-12-07
### Added
@@ -24,7 +28,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- sponsoredProducts query.
-
## [0.54.0] - 2023-08-03
### Added
diff --git a/docs/README.md b/docs/README.md
index bf4814d..d9f0962 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -143,7 +143,7 @@ Pagination item end
If true, uses isAvailablePerSalesChannel_ parameter on query with segment's sales channel. Will override any given salesChannel arg
simulationBehavior | SimulationBehavior |
If you want faster searches and do not care about most up to date prices and promotions, use skip value.
- |
productRecommendations | [Product] | |
identifier | ProductUniqueIdentifier | |
type | CrossSelingInputEnum | |
productsByIdentifier | [Product] | |
field | ProductUniqueIdentifierField! | |
values | [ID!] | |
salesChannel | String |
+ |
productRecommendations | [Product] | |
identifier | ProductUniqueIdentifier | |
type | CrossSelingInputEnum | |
groupByProduct | Boolean | |
productsByIdentifier | [Product] | |
field | ProductUniqueIdentifierField! | |
values | [ID!] | |
salesChannel | String |
Filter by availability at a specific sales channel.
|
facets | Facets |
Returns facets category
@@ -536,7 +536,7 @@ Indicates how the search-engine will deal with the fullText if there is more tha
### Recommendation
-
+
### Reference
@@ -730,6 +730,9 @@ Returns all available items. Returns first if no item is available.
### SORT
+### SimilarProductsQuantityEnum
+Value | Description | ALL_AVAILABLE | Returns all similar products by setting "groupByProduct" param to `false` | DEFAULT | Returns 12 similar products by default |
+
### SimulationBehavior
Value | Description | default |
Does simulation on catalog as usual
diff --git a/graphql/schema.graphql b/graphql/schema.graphql
index a66333e..5756c1e 100644
--- a/graphql/schema.graphql
+++ b/graphql/schema.graphql
@@ -316,6 +316,7 @@ type Query {
productRecommendations(
identifier: ProductUniqueIdentifier
type: CrossSelingInputEnum
+ groupByProduct: Boolean
): [Product] @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment
productsByIdentifier(
diff --git a/graphql/types/Product.graphql b/graphql/types/Product.graphql
index 7e8888b..81d07ef 100644
--- a/graphql/types/Product.graphql
+++ b/graphql/types/Product.graphql
@@ -182,12 +182,23 @@ type Seller {
addToCartLink: String
sellerDefault: Boolean
commertialOffer: Offer
+}
+
+enum SimilarProductsQuantityEnum {
+ """
+ Returns all similar products by setting "groupByProduct" param to `false`
+ """
+ ALL_AVAILABLE
+ """
+ Returns 12 similar products by default
+ """
+ DEFAULT
}
type Recommendation {
buy: [Product]
view: [Product]
- similars: [Product]
+ similars(quantity: SimilarProductsQuantityEnum): [Product]
}
type SKU {
|
|