Updates to the GraphQL references
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 theProductDiscount
type.
- Added the
- [GraphQL API] Changed the
ProductPrice
type:ProductPrice.channel
field type changed fromReference
toChannel
ProductPrice.customerGroup
field type changed fromReference
toCustomerGroup
- Added the
customerGroupRef
field to theProductPrice
type. - Added the
channelRef
field to theProductPrice
type.
- [GraphQL API] Changed the
ShippingInfo
type:- Added the
taxCategoryRef
field to theShippingInfo
type. ShippingInfo.taxCategory
field type changed fromReference
toTaxCategory
- Added the
- [GraphQL API] Changed the
CartDiscount
type:- Added the
referenceRefs
field to theCartDiscount
type.
- Added the
- [GraphQL API] Changed the
InventoryEntry
type:InventoryEntry.supplyChannel
field type changed fromReference
toChannel
- Added the
supplyChannelRef
field to theInventoryEntry
type.
- [GraphQL API] Changed the
DiscountCode
type:- Added the
referenceRefs
field to theDiscountCode
type.
- Added the
Introduced the following changes to the GraphQL schema (in SDL format):
extend type ProductDiscount {referenceRefs: [Reference!]!}extend type ProductPrice {channelRef: ReferencecustomerGroupRef: Reference}extend type ShippingInfo {taxCategoryRef: Reference}extend type CartDiscount {referenceRefs: [Reference!]!}extend type InventoryEntry {supplyChannelRef: Reference}extend type DiscountCode {referenceRefs: [Reference!]!}