All Release Notes

Improvements to working with Business Units in the GraphQL API

7 December 2022
Enhancement
GraphQLCartsOrdersB2B

We have made several improvements and changes to the Business Units functionality in GraphQL:

  • Carts and Orders now support Reference Expansion on Business Unit.
  • Added support for creating Carts that reference a Business Unit.
  • Changed the naming of the type AssociateRole to free up the namespace for new functionality.

Changes:

  • [GraphQL API] Changed the Cart type:
    • Added the businessUnitRef field to the Cart type.
    • Cart.businessUnit field type changed from KeyReference to BusinessUnit
  • [GraphQL API] Changed the Order type:
    • Order.businessUnit field type changed from KeyReference to BusinessUnit
    • Added the businessUnitRef field to the Order type.
  • [GraphQL API] Changed the CartDraft type:
    • Input field businessUnit was added to CartDraft type
  • [GraphQL API] Changed the MyCartDraft type:
    • Input field businessUnit was added to MyCartDraft type
  • [GraphQL API] Added the following types to the GraphQL schema: SimpleAssociateRole
  • [GraphQL API] Removed the following types from the GraphQL schema: AssociateRole.
  • [GraphQL API] Changed the Associate type:
    • Associate.roles field type changed from [AssociateRole!]! to [SimpleAssociateRole!]!
  • [GraphQL API] Changed the AssociateDraft type:
    • AssociateDraft.roles input field type changed from [AssociateRole!]! to [SimpleAssociateRole!]!

The following changes were introduced in terms of GraphQL SDL:

extend type Cart {
businessUnitRef: KeyReference
}
extend type Order {
businessUnitRef: KeyReference
}
extend input MyCartDraft {
businessUnit: ResourceIdentifierInput
}
extend input CartDraft {
businessUnit: ResourceIdentifierInput
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
enum SimpleAssociateRole {
Admin
Buyer
}