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 simulationBehaviorSimulationBehavior If you want faster searches and do not care about most up to date prices and promotions, use skip value. -productRecommendations[Product]identifierProductUniqueIdentifiertypeCrossSelingInputEnumproductsByIdentifier[Product]fieldProductUniqueIdentifierField!values[ID!]salesChannelString +productRecommendations[Product]identifierProductUniqueIdentifiertypeCrossSelingInputEnumgroupByProductBooleanproductsByIdentifier[Product]fieldProductUniqueIdentifierField!values[ID!]salesChannelString Filter by availability at a specific sales channel. facetsFacets Returns facets category @@ -536,7 +536,7 @@ Indicates how the search-engine will deal with the fullText if there is more tha
FieldArgumentTypeDescription
fromFloat
toFloat
### Recommendation -
FieldArgumentTypeDescription
buy[Product]
view[Product]
similars[Product]
+
FieldArgumentTypeDescription
buy[Product]
view[Product]
similars[Product]
quantitySimilarProductsQuantityEnum
### Reference
FieldArgumentTypeDescription
KeyString
ValueString
@@ -730,6 +730,9 @@ Returns all available items. Returns first if no item is available. ### SORT
ValueDescription
ASC
DESC
+### SimilarProductsQuantityEnum +
ValueDescription
ALL_AVAILABLEReturns all similar products by setting "groupByProduct" param to `false`
DEFAULTReturns 12 similar products by default
+ ### SimulationBehavior
ValueDescription
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 {