29 June 2022
Product catalogProject configurationMessages/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:
- [API] You can now specify a Product Variant Selection when you Add a Product to the Product Selection.
 - [API] You can now specify a Product Variant Selection for an existing Product in the Product Selection by the new Set Variant Selection update action.
 - [API] When you query a Product Selection for Products assigned to a Product Selection the response now also contains Product Variant Selections.
 - [API] When you query for Products available in a Store through active Product Selections the response now also contains Product Variant Selections.
 - [API] When you Get Product Projection in Store by ID or by Key you can now project by Product Selection assignments for Product Variants.
 - [API] Added 
variantSelectionfield to ProductSelectionProductAdded Message. - [API] Added ProductSelectionVariantSelectionChanged Message.
 - [API] Added 
ProductAssignmentMissingandProductPresentWithDifferentVariantSelectionerrors. - [GraphQL API] Added the following types to the GraphQL schema: 
ProductSelectionVariantSelectionChanged,ProductVariantSelection,ProductVariantSelectionDraft,ProductVariantSelectionExclusion,ProductVariantSelectionInclusion,SetProductSelectionVariantSelection. - [GraphQL API] Changed the 
ProductOfSelectiontype:- Added the 
variantSelectionfield to theProductOfSelectiontype. 
 - Added the 
 - [GraphQL API] Changed the 
SelectionOfProducttype:- Added the 
variantSelectionfield to theSelectionOfProducttype. 
 - Added the 
 - [GraphQL API] Changed the 
ProductSelectionUpdateActiontype:- Input field 
setVariantSelectionwas added toProductSelectionUpdateActiontype 
 - Input field 
 - [GraphQL API] Changed the 
AddProductSelectionProducttype:- Input field 
variantSelectionwas added toAddProductSelectionProducttype 
 - Input field 
 - [GraphQL API] Changed the 
ProductSelectionProductAddedtype:- Added the 
variantSelectionfield to theProductSelectionProductAddedtype. 
 - Added the 
 
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!
}