All Release Notes
Added GraphQL support for multiple shipping methods
31 January 2023
Composable Commerce
HTTP API
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
MyCartDrafttype:- Input field
shippingModewas added toMyCartDrafttype - Input field
customShippingwas added toMyCartDrafttype - Input field
shippingwas added toMyCartDrafttype
- Input field
- [GraphQL API] Changed the
CartDrafttype:- Input field
customShippingwas added toCartDrafttype - Input field
shippingwas added toCartDrafttype - Input field
shippingModewas added toCartDrafttype
- Input field
- [GraphQL API] Changed the
CartUpdateActiontype:- Input field
addCustomShippingMethodwas added toCartUpdateActiontype - Input field
removeShippingMethodwas added toCartUpdateActiontype - Input field
addShippingMethodwas added toCartUpdateActiontype
- Input field
- [GraphQL API] Changed the
Carttype:- Added the
taxedShippingPricefield to theCarttype. - Added the
shippingfield to theCarttype. - Added the
shippingModefield to theCarttype.
- Added the
- [GraphQL API] Changed the
Ordertype:- Added the
taxedShippingPricefield to theOrdertype. - Added the
shippingfield to theOrdertype. - Added the
shippingModefield to theOrdertype.
- Added the
- [GraphQL API] Changed the
LineItemtype:- Added the
perMethodTaxRatefield to theLineItemtype. - Added the
taxedPricePortionsfield to theLineItemtype.
- Added the
- [GraphQL API] Changed the
ShippingTargetDrafttype:- Added the
shippingMethodKeyfield to theShippingTargetDrafttype.
- 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}