From 9644b6129a75495820fbb655fc803dff2adc39be Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Wed, 17 Mar 2021 21:29:47 -0500 Subject: [PATCH 1/6] - add quote interface for common fields --- .../graph-ql/coverage/b2b/negotiableQuotes.graphqls | 5 +---- design-documents/graph-ql/coverage/quote.graphqls | 12 +++++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls b/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls index 71ad69b77..dc3fe2637 100644 --- a/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls +++ b/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls @@ -165,15 +165,12 @@ enum NegotiableQuoteCommentCreatorType { SELLER } -type NegotiableQuote { - uid: ID! +type NegotiableQuote implements QuoteInterface { name: String! - items: [CartItemInterface!] # Attachment Support is dependent on headless File Upload design # attachments: [AttachmentContent] comments: [NegotiableQuoteComment!] history: [NegotiableQuoteHistoryEntry!] - prices: CartPrices buyer: NegotiableQuoteUser! created_at: String @doc(description: "Timestamp indicating when the negotiable quote was created.") updated_at: String @doc(description: "Timestamp indicating when the negotiable quote was updated.") diff --git a/design-documents/graph-ql/coverage/quote.graphqls b/design-documents/graph-ql/coverage/quote.graphqls index 4d38f67bb..ec6a495f9 100644 --- a/design-documents/graph-ql/coverage/quote.graphqls +++ b/design-documents/graph-ql/coverage/quote.graphqls @@ -224,7 +224,17 @@ type PlaceOrderOutput { order: Order! } -type Cart { +interface QuoteInterface { + uid: ID! + items: [CartItemInterface] + prices: CartPrices +} + +interface QuoteItemInterface { + uid: ID! +} + +type Cart implements QuoteInterface{ id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The ID of the cart.") items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") From 0c9d5ae6d6ce13e197bee1f6298829d6ed8fd8ae Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 29 Mar 2021 10:07:38 -0500 Subject: [PATCH 2/6] - move common fields in interface --- .../coverage/b2b/negotiableQuotes.graphqls | 2 +- .../graph-ql/coverage/quote.graphqls | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls b/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls index dc3fe2637..b5151223e 100644 --- a/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls +++ b/design-documents/graph-ql/coverage/b2b/negotiableQuotes.graphqls @@ -279,7 +279,7 @@ type NegotiableQuoteHistoryProductsRemovedChange { # Usage in Luma: https://github.com/magento/magento2b2b/blob/0e791b5f7cd604ee6ee40b7225807c01b7f70cf2/app/code/Magento/NegotiableQuote/view/base/templates/quote/history.phtml#L148-L169 type NegotiableQuoteHistoryProductsAddedChange { - # TODO: List of products added and their respective options. + # TODO: List of products added and their respective options. } # Usage in Luma: https://github.com/magento/magento2b2b/blob/0e791b5f7cd604ee6ee40b7225807c01b7f70cf2/app/code/Magento/NegotiableQuote/view/base/templates/quote/history.phtml#L172-L197 diff --git a/design-documents/graph-ql/coverage/quote.graphqls b/design-documents/graph-ql/coverage/quote.graphqls index ec6a495f9..c14d687fe 100644 --- a/design-documents/graph-ql/coverage/quote.graphqls +++ b/design-documents/graph-ql/coverage/quote.graphqls @@ -227,7 +227,14 @@ type PlaceOrderOutput { interface QuoteInterface { uid: ID! items: [CartItemInterface] - prices: CartPrices + total_quantity: Float! + is_virtual: Boolean! + prices: CartPrices! + applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") + shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") + billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") + available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods") + selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") } interface QuoteItemInterface { @@ -235,18 +242,10 @@ interface QuoteItemInterface { } type Cart implements QuoteInterface{ - id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The ID of the cart.") + id: ID! @deprecated(reason: "Use `QuoteInterface.uid` instead") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The ID of the cart.") items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") - applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") - applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") + applied_coupon: AppliedCoupon @deprecated(reason: "Use `applied_coupons` instead") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") - shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") - billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") - available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods") - selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") - prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices") - total_quantity: Float! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity") - is_virtual: Boolean! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartIsVirtual") } interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") { From c40d66338fcca2063ad6c43c9537f6f8b5f9d2db Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 29 Mar 2021 10:16:31 -0500 Subject: [PATCH 3/6] - remove resolvers --- .../graph-ql/coverage/quote.graphqls | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/design-documents/graph-ql/coverage/quote.graphqls b/design-documents/graph-ql/coverage/quote.graphqls index c14d687fe..b63ae48e5 100644 --- a/design-documents/graph-ql/coverage/quote.graphqls +++ b/design-documents/graph-ql/coverage/quote.graphqls @@ -2,27 +2,27 @@ # See COPYING.txt for license details. type Query { - cart(cart_id: String!): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Returns information about shopping cart") @cache(cacheable: false) - customerCart: Cart! @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CustomerCart") @doc(description:"Returns information about the customer shopping cart") @cache(cacheable: false) + cart(cart_id: String!): Cart @doc(description:"Returns information about shopping cart") @cache(cacheable: false) + customerCart: Cart! @doc(description:"Returns information about the customer shopping cart") @cache(cacheable: false) } type Mutation { - createEmptyCart(input: createEmptyCartInput): String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates an empty shopping cart for a guest or logged in user") - addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") - addVirtualProductsToCart(input: AddVirtualProductsToCartInput): AddVirtualProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") - applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart") - removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart") - updateCartItems(input: UpdateCartItemsInput): UpdateCartItemsOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\UpdateCartItems") - removeItemFromCart(input: RemoveItemFromCartInput): RemoveItemFromCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveItemFromCart") - setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart") - setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart") - setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart") - setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentMethodOnCart") - setGuestEmailOnCart(input: SetGuestEmailOnCartInput): SetGuestEmailOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetGuestEmailOnCart") - setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput @deprecated(reason: "Should use setPaymentMethodOnCart and placeOrder mutations in single request.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentAndPlaceOrder") - mergeCarts(source_cart_id: String!, destination_cart_id: String!): Cart! @doc(description:"Merges the source cart into the destination cart") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\MergeCarts") - placeOrder(input: PlaceOrderInput): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder") - addProductsToCart(cartId: String!, cartItems: [CartItemInput!]!): AddProductsToCartOutput @doc(description:"Add any type of product to the cart") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddProductsToCart") + createEmptyCart(input: createEmptyCartInput): String @doc(description:"Creates an empty shopping cart for a guest or logged in user") + addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput + addVirtualProductsToCart(input: AddVirtualProductsToCartInput): AddVirtualProductsToCartOutput + applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput + removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput + updateCartItems(input: UpdateCartItemsInput): UpdateCartItemsOutput + removeItemFromCart(input: RemoveItemFromCartInput): RemoveItemFromCartOutput + setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput + setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput + setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput + setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput + setGuestEmailOnCart(input: SetGuestEmailOnCartInput): SetGuestEmailOnCartOutput + setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput @deprecated(reason: "Should use setPaymentMethodOnCart and placeOrder mutations in single request.") + mergeCarts(source_cart_id: String!, destination_cart_id: String!): Cart! @doc(description:"Merges the source cart into the destination cart") + placeOrder(input: PlaceOrderInput): PlaceOrderOutput + addProductsToCart(cartId: String!, cartItems: [CartItemInput!]!): AddProductsToCartOutput @doc(description:"Add any type of product to the cart") } input createEmptyCartInput { @@ -86,7 +86,7 @@ input CartItemUpdateInput { # When `cart_item_id` is removed in a future version, we can mark `cart_item_uid` as non-nullable # with minimal disruption cart_item_id: Int @deprecated(reason: "Use the `cart_item_uid` field instead") - cart_item_interface_uid: ID @doc(description: "Required field. Unique Identifier from objects implementing `CartItemInterface`") + cart_item_interface_uid: ID! @doc(description: "Required field. Unique Identifier from objects implementing `CartItemInterface`") quantity: Float customizable_options: [CustomizableOptionInput!] } @@ -106,7 +106,7 @@ input RemoveItemFromCartInput { # When `cart_item_id` is removed in a future version, we can mark `cart_item_uid` as non-nullable # with minimal disruption cart_item_id: Int @deprecated(reason: "Use the `cart_item_uid` field instead") - cart_item_interface_uid: ID @doc(description: "Required field. Unique Identifier from objects implementing `CartItemInterface`") + cart_item_interface_uid: ID! @doc(description: "Required field. Unique Identifier from objects implementing `CartItemInterface`") } input SetShippingAddressesOnCartInput { @@ -187,7 +187,7 @@ type CartPrices { discount: CartDiscount @deprecated(reason: "Use discounts instead ") subtotal_with_discount_excluding_tax: Money applied_taxes: [CartTaxItem] - discounts: [Discount] @doc(description:"An array of applied discounts") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Discounts") + discounts: [Discount] @doc(description:"An array of applied discounts") } type CartTaxItem { @@ -230,11 +230,11 @@ interface QuoteInterface { total_quantity: Float! is_virtual: Boolean! prices: CartPrices! - applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") - shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") - billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") - available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods") - selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") + applied_coupons: [AppliedCoupon] @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") + shipping_addresses: [ShippingCartAddress]! + billing_address: BillingCartAddress + available_payment_methods: [AvailablePaymentMethod] @doc(description: "Available payment methods") + selected_payment_method: SelectedPaymentMethod } interface QuoteItemInterface { @@ -242,9 +242,9 @@ interface QuoteItemInterface { } type Cart implements QuoteInterface{ - id: ID! @deprecated(reason: "Use `QuoteInterface.uid` instead") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The ID of the cart.") - items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") - applied_coupon: AppliedCoupon @deprecated(reason: "Use `applied_coupons` instead") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") + id: ID! @deprecated(reason: "Use `QuoteInterface.uid` instead") @doc(description: "The ID of the cart.") + items: [CartItemInterface] + applied_coupon: AppliedCoupon @deprecated(reason: "Use `applied_coupons` instead") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") } @@ -261,8 +261,8 @@ interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Mo } type ShippingCartAddress implements CartAddressInterface { - available_shipping_methods: [AvailableShippingMethod] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\AvailableShippingMethods") - selected_shipping_method: SelectedShippingMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\SelectedShippingMethod") + available_shipping_methods: [AvailableShippingMethod] + selected_shipping_method: SelectedShippingMethod customer_notes: String items_weight: Float @deprecated(reason: "This information shoud not be exposed on frontend") cart_items: [CartItemQuantity] @deprecated(reason: "`cart_items_v2` should be used instead") @@ -355,18 +355,18 @@ type SetGuestEmailOnCartOutput { } type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption] } type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption] } interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { id: String! @deprecated(reason: "Use CartItemInterface.uid instead") uid: ID! @doc(description: "Unique identifier for a Cart Item") quantity: Float! - prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") + prices: CartItemPrices product: ProductInterface! } From 2295239ebd4286142ccd497cefc2d67beba52a4d Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 29 Mar 2021 10:18:45 -0500 Subject: [PATCH 4/6] - remove resolvers --- design-documents/graph-ql/coverage/quote.graphqls | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/design-documents/graph-ql/coverage/quote.graphqls b/design-documents/graph-ql/coverage/quote.graphqls index b63ae48e5..6fc28657c 100644 --- a/design-documents/graph-ql/coverage/quote.graphqls +++ b/design-documents/graph-ql/coverage/quote.graphqls @@ -245,10 +245,10 @@ type Cart implements QuoteInterface{ id: ID! @deprecated(reason: "Use `QuoteInterface.uid` instead") @doc(description: "The ID of the cart.") items: [CartItemInterface] applied_coupon: AppliedCoupon @deprecated(reason: "Use `applied_coupons` instead") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") - email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") + email: String } -interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") { +interface CartAddressInterface { firstname: String! lastname: String! company: String @@ -362,7 +362,7 @@ type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Car customizable_options: [SelectedCustomizableOption] } -interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { +interface CartItemInterface { id: String! @deprecated(reason: "Use CartItemInterface.uid instead") uid: ID! @doc(description: "Unique identifier for a Cart Item") quantity: Float! From a29edea8ca8f80eae76434c5c8d34b3f434098ff Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 29 Mar 2021 10:49:39 -0500 Subject: [PATCH 5/6] - make some objects non nullable --- design-documents/graph-ql/coverage/quote.graphqls | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/design-documents/graph-ql/coverage/quote.graphqls b/design-documents/graph-ql/coverage/quote.graphqls index 6fc28657c..72b266bba 100644 --- a/design-documents/graph-ql/coverage/quote.graphqls +++ b/design-documents/graph-ql/coverage/quote.graphqls @@ -226,14 +226,14 @@ type PlaceOrderOutput { interface QuoteInterface { uid: ID! - items: [CartItemInterface] + items: [CartItemInterface]! total_quantity: Float! is_virtual: Boolean! prices: CartPrices! - applied_coupons: [AppliedCoupon] @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") - shipping_addresses: [ShippingCartAddress]! + applied_coupons: [AppliedCoupon]! @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") + shipping_addresses: [ShippingCartAddress] @doc(description: "Shipping addresses, if applicable or set") billing_address: BillingCartAddress - available_payment_methods: [AvailablePaymentMethod] @doc(description: "Available payment methods") + available_payment_methods: [AvailablePaymentMethod] @doc(description: "Available payment methods, if applicable") selected_payment_method: SelectedPaymentMethod } @@ -243,8 +243,7 @@ interface QuoteItemInterface { type Cart implements QuoteInterface{ id: ID! @deprecated(reason: "Use `QuoteInterface.uid` instead") @doc(description: "The ID of the cart.") - items: [CartItemInterface] - applied_coupon: AppliedCoupon @deprecated(reason: "Use `applied_coupons` instead") @doc(description:"An array of coupons that have been applied to the cart") @deprecated(reason: "Use applied_coupons instead ") + applied_coupon: AppliedCoupon @deprecated(reason: "Use `applied_coupons` instead ") @doc(description:"An array of coupons that have been applied to the cart") email: String } From 5196f5087a2ea59e3c68934a70fc5446a8221cff Mon Sep 17 00:00:00 2001 From: Cristian Partica Date: Mon, 29 Mar 2021 11:26:29 -0500 Subject: [PATCH 6/6] - make some objects non nullable --- design-documents/graph-ql/coverage/quote.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design-documents/graph-ql/coverage/quote.graphqls b/design-documents/graph-ql/coverage/quote.graphqls index 72b266bba..62f6f60ed 100644 --- a/design-documents/graph-ql/coverage/quote.graphqls +++ b/design-documents/graph-ql/coverage/quote.graphqls @@ -231,9 +231,9 @@ interface QuoteInterface { is_virtual: Boolean! prices: CartPrices! applied_coupons: [AppliedCoupon]! @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code") - shipping_addresses: [ShippingCartAddress] @doc(description: "Shipping addresses, if applicable or set") + shipping_addresses: [ShippingCartAddress]! @doc(description: "Set Shipping addresses") billing_address: BillingCartAddress - available_payment_methods: [AvailablePaymentMethod] @doc(description: "Available payment methods, if applicable") + available_payment_methods: [AvailablePaymentMethod]! @doc(description: "Available payment methods based on different factors") selected_payment_method: SelectedPaymentMethod }