All Release Notes
Added GraphQL support for multiple shipping methods
31 January 2023
Enhancement
CartsOrdersGraphQL
To align with the HTTP API, multiple Shipping Methods are now supported on Carts and Orders in the GraphQL API.
Changes:
- [GraphQL API] Added the following types to the GraphQL schema:
AddCartCustomShippingMethod
,AddCartShippingMethod
,CustomShippingDraft
,MethodTaxRate
,RemoveCartShippingMethod
,Shipping
,ShippingDraft
,ShippingMode
. - [GraphQL API] Changed the
MyCartDraft
type:- Input field
shippingMode
was added toMyCartDraft
type - Input field
customShipping
was added toMyCartDraft
type - Input field
shipping
was added toMyCartDraft
type
- Input field
- [GraphQL API] Changed the
CartDraft
type:- Input field
customShipping
was added toCartDraft
type - Input field
shipping
was added toCartDraft
type - Input field
shippingMode
was added toCartDraft
type
- Input field
- [GraphQL API] Changed the
CartUpdateAction
type:- Input field
addCustomShippingMethod
was added toCartUpdateAction
type - Input field
removeShippingMethod
was added toCartUpdateAction
type - Input field
addShippingMethod
was added toCartUpdateAction
type
- Input field
- [GraphQL API] Changed the
Cart
type:- Added the
taxedShippingPrice
field to theCart
type. - Added the
shipping
field to theCart
type. - Added the
shippingMode
field to theCart
type.
- Added the
- [GraphQL API] Changed the
Order
type:- Added the
taxedShippingPrice
field to theOrder
type. - Added the
shipping
field to theOrder
type. - Added the
shippingMode
field to theOrder
type.
- Added the
- [GraphQL API] Changed the
LineItem
type:- Added the
perMethodTaxRate
field to theLineItem
type. - Added the
taxedPricePortions
field to theLineItem
type.
- Added the
- [GraphQL API] Changed the
ShippingTargetDraft
type:- Added the
shippingMethodKey
field to theShippingTargetDraft
type.
- Added the
The following changes were introduced in terms of GraphQL SDL:
extend type Cart {shipping: [Shipping!]!shippingMode: ShippingMode!taxedShippingPrice: TaxedPrice}extend type Order {shipping: [Shipping!]!shippingMode: ShippingMode!taxedShippingPrice: TaxedPrice}extend type LineItem {perMethodTaxRate: [MethodTaxRate!]!taxedPricePortions: [MethodTaxedPrice!]!}extend input MyCartDraft {customShipping: [CustomShippingDraft!] = []shipping: [ShippingDraft!] = []shippingMode: ShippingMode = Single}extend input CartDraft {customShipping: [CustomShippingDraft!] = []shipping: [ShippingDraft!] = []shippingMode: ShippingMode = Single}extend input CartUpdateAction {addCustomShippingMethod: AddCartCustomShippingMethodaddShippingMethod: AddCartShippingMethodremoveShippingMethod: RemoveCartShippingMethod}extend input ShippingTargetDraft {shippingMethodKey: String}input AddCartCustomShippingMethod {shippingKey: String!shippingMethodName: String!shippingAddress: AddressInput!shippingRate: ShippingRateDraft!shippingRateInput: ShippingRateInputDrafttaxCategory: ResourceIdentifierInputexternalTaxRate: ExternalTaxRateDraftcustom: CustomFieldsDraftdeliveries: [DeliveryDraft!] = []}input AddCartShippingMethod {shippingKey: String!shippingMethod: ResourceIdentifierInput!externalTaxRate: ExternalTaxRateDraftshippingAddress: AddressInput!shippingRateInput: ShippingRateInputDraftcustom: CustomFieldsDraftdeliveries: [DeliveryDraft!] = []}input CustomShippingDraft {key: String!shippingMethodName: String!shippingAddress: AddressInput!shippingRate: ShippingRateDraft!shippingRateInput: ShippingRateInputDrafttaxCategory: ReferenceInputexternalTaxRate: ExternalTaxRateDraftdeliveries: [DeliveryDraft!]custom: CustomFieldsDraft}type MethodTaxRate {shippingMethodKey: String!taxRate: TaxRate}input RemoveCartShippingMethod {shippingKey: String!}type Shipping {shippingKey: StringshippingInfo: ShippingInfoshippingAddress: AddressshippingRateInput: ShippingRateInputshippingCustomFields: CustomFieldsType}input ShippingDraft {key: String!shippingMethod: ResourceIdentifierInputshippingAddress: AddressInput!shippingRateInput: ShippingRateInputDraftexternalTaxRate: ExternalTaxRateDraftdeliveries: [DeliveryDraft!]custom: CustomFieldsDraft}enum ShippingMode {"Allows multiple shipping methods for the cart with their respective shipping addresses"Multiple"Allows only one shipping method and shipping address for the cart"Single}