All Release Notes

Product Selections can now operate on Product Variant level

29 June 2022
Enhancement
Product CatalogStoresMessages/SubscriptionsGraphQL

You can now include or exclude particular Product Variants in/from a Product Selection. Formerly it was only possible to add Products as a whole to a Product Selection meaning that all existing Product Variants of the Product are included.

Changes:

The following changes were introduced in terms of GraphQL SDL:

extend type ProductOfSelection {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"
variantSelection: ProductVariantSelection
}
extend type SelectionOfProduct {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"
variantSelection: ProductVariantSelection
}
extend input ProductSelectionUpdateAction {
setVariantSelection: SetProductSelectionVariantSelection
}
extend input AddProductSelectionProduct {
variantSelection: ProductVariantSelectionDraft
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"
interface ProductVariantSelection {
type: String!
skus: [String!]!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"
input ProductVariantSelectionDraft {
inclusion: [String!]
exclusion: [String!]
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"
type ProductVariantSelectionExclusion implements ProductVariantSelection {
type: String!
skus: [String!]!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#beta-features"
type ProductVariantSelectionInclusion implements ProductVariantSelection {
type: String!
skus: [String!]!
}
input SetProductSelectionVariantSelection {
product: ResourceIdentifierInput!
variantSelection: ProductVariantSelectionDraft
}
extend type ProductSelectionProductAdded {
variantSelection: ProductVariantSelection
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ProductSelectionVariantSelectionChanged implements MessagePayload {
oldVariantSelection: ProductVariantSelection
newVariantSelection: ProductVariantSelection
product: Product
productRef: Reference!
type: String!
}