All Release Notes

Updates to the GraphQL references

17 January 2020
Composable Commerce
HTTP API
Enhancement
CartsGraphQLPricing and Discounts

We have made some changes on the GraphQL API that affect referenced resources in product prices, discounts, discount codes, inventory entries and shipping infos.
The reference fields on those resources now support querying for the data stored in referenced objects, similar to Reference Expansion on the HTTP API. The plain reference can now be queried with the corresponding <fieldName>Ref field that has been introduced on the mentioned resources. If you, for example for performance reasons, want to continue using the plain references, you should amend your queries to use the corresponding <fieldName>Ref field instead of the <fieldName> field.
For backward compatibility reasons, the typeId field is still available on the <fieldName> queries, but it is now deprecated. It will be removed from the API after April 2020.

  • [GraphQL API] Changed the ProductDiscount type:
    • Added the referenceRefs field to the ProductDiscount type.
  • [GraphQL API] Changed the ProductPrice type:
    • ProductPrice.channel field type changed from Reference to Channel
    • ProductPrice.customerGroup field type changed from Reference to CustomerGroup
    • Added the customerGroupRef field to the ProductPrice type.
    • Added the channelRef field to the ProductPrice type.
  • [GraphQL API] Changed the ShippingInfo type:
    • Added the taxCategoryRef field to the ShippingInfo type.
    • ShippingInfo.taxCategory field type changed from Reference to TaxCategory
  • [GraphQL API] Changed the CartDiscount type:
    • Added the referenceRefs field to the CartDiscount type.
  • [GraphQL API] Changed the InventoryEntry type:
    • InventoryEntry.supplyChannel field type changed from Reference to Channel
    • Added the supplyChannelRef field to the InventoryEntry type.
  • [GraphQL API] Changed the DiscountCode type:
    • Added the referenceRefs field to the DiscountCode type.

Introduced the following changes to the GraphQL schema (in SDL format):

extend type ProductDiscount {
referenceRefs: [Reference!]!
}
extend type ProductPrice {
channelRef: Reference
customerGroupRef: Reference
}
extend type ShippingInfo {
taxCategoryRef: Reference
}
extend type CartDiscount {
referenceRefs: [Reference!]!
}
extend type InventoryEntry {
supplyChannelRef: Reference
}
extend type DiscountCode {
referenceRefs: [Reference!]!
}