-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3844 from magento-engcom/ENGCOM-4431
GraphQL-433: Prepare Quote GraphQL scheme for 2.3.1 release
- Loading branch information
Showing
7 changed files
with
9 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,232 +1,6 @@ | ||
# Copyright © Magento, Inc. All rights reserved. | ||
# 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") | ||
} | ||
|
||
type Mutation { | ||
createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates an empty shopping cart for a guest or logged in user") | ||
applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\ApplyCouponToCart") | ||
removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\RemoveCouponFromCart") | ||
setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart") | ||
applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart") | ||
removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart") | ||
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart") | ||
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart") | ||
addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") | ||
} | ||
|
||
input SetShippingAddressesOnCartInput { | ||
cart_id: String! | ||
shipping_addresses: [ShippingAddressInput!]! | ||
} | ||
|
||
input ShippingAddressInput { | ||
customer_address_id: Int # Can be provided in one-page checkout and is required for multi-shipping checkout | ||
address: CartAddressInput | ||
cart_items: [CartItemQuantityInput!] | ||
} | ||
|
||
input CartItemQuantityInput { | ||
cart_item_id: Int! | ||
quantity: Float! | ||
} | ||
|
||
input SetBillingAddressOnCartInput { | ||
cart_id: String! | ||
billing_address: BillingAddressInput! | ||
} | ||
|
||
input BillingAddressInput { | ||
customer_address_id: Int | ||
address: CartAddressInput | ||
use_for_shipping: Boolean | ||
} | ||
|
||
input CartAddressInput { | ||
firstname: String! | ||
lastname: String! | ||
company: String | ||
street: [String!]! | ||
city: String! | ||
region: String | ||
postcode: String | ||
country_code: String! | ||
telephone: String! | ||
save_in_address_book: Boolean! | ||
} | ||
|
||
input SetShippingMethodsOnCartInput { | ||
cart_id: String! | ||
shipping_methods: [ShippingMethodForAddressInput!]! | ||
} | ||
|
||
input ShippingMethodForAddressInput { | ||
cart_address_id: Int! | ||
carrier_code: String! | ||
method_code: String! | ||
} | ||
|
||
type SetBillingAddressOnCartOutput { | ||
cart: Cart! | ||
} | ||
|
||
type SetShippingAddressesOnCartOutput { | ||
cart: Cart! | ||
} | ||
|
||
type SetShippingMethodsOnCartOutput { | ||
cart: Cart! | ||
} | ||
|
||
# If no address is provided, the system get address assigned to a quote | ||
# If there's no address at all - the system returns all shipping methods | ||
input AvailableShippingMethodsOnCartInput { | ||
cart_id: String! | ||
customer_address_id: Int | ||
address: CartAddressInput | ||
} | ||
|
||
input ApplyCouponToCartInput { | ||
cart_id: String! | ||
coupon_code: String! | ||
} | ||
|
||
type ApplyCouponToCartOutput { | ||
cart: Cart! | ||
} | ||
|
||
type Cart { | ||
cart_id: String | ||
items: [CartItemInterface] | ||
applied_coupon: AppliedCoupon | ||
shipping_addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") | ||
billing_address: CartAddress! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") | ||
} | ||
|
||
type CartAddress { | ||
firstname: String | ||
lastname: String | ||
company: String | ||
street: [String] | ||
city: String | ||
region: CartAddressRegion | ||
postcode: String | ||
country: CartAddressCountry | ||
telephone: String | ||
address_type: AdressTypeEnum | ||
items_weight: Float | ||
customer_notes: String | ||
cart_items: [CartItemQuantity] | ||
} | ||
|
||
type CartItemQuantity { | ||
cart_item_id: String! | ||
quantity: Float! | ||
} | ||
|
||
type CartAddressRegion { | ||
code: String | ||
label: String | ||
} | ||
|
||
type CartAddressCountry { | ||
code: String | ||
label: String | ||
} | ||
|
||
type SelectedShippingMethod { | ||
amount: Float! | ||
} | ||
|
||
type AvailableShippingMethod { | ||
carrier_code: String! | ||
carrier_title: String! | ||
method_code: String! | ||
method_title: String! | ||
error_message: String | ||
amount: Float! | ||
base_amount: Float! | ||
price_excl_tax: Float! | ||
price_incl_tax: Float! | ||
} | ||
|
||
enum AdressTypeEnum { | ||
SHIPPING | ||
BILLING | ||
} | ||
|
||
type AppliedCoupon { | ||
code: String! | ||
} | ||
|
||
input RemoveCouponFromCartInput { | ||
cart_id: String! | ||
} | ||
|
||
type RemoveCouponFromCartOutput { | ||
cart: Cart | ||
} | ||
|
||
input AddSimpleProductsToCartInput { | ||
cart_id: String! | ||
cartItems: [SimpleProductCartItemInput!]! | ||
} | ||
|
||
input SimpleProductCartItemInput { | ||
data: CartItemInput! | ||
customizable_options:[CustomizableOptionInput!] | ||
} | ||
|
||
input CustomizableOptionInput { | ||
id: Int! | ||
value: String! | ||
} | ||
|
||
type AddSimpleProductsToCartOutput { | ||
cart: Cart! | ||
} | ||
|
||
type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") { | ||
customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") | ||
} | ||
|
||
input CartItemInput { | ||
sku: String! | ||
qty: Float! | ||
} | ||
|
||
interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { | ||
id: String! | ||
qty: Float! | ||
product: ProductInterface! | ||
} | ||
|
||
type SelectedCustomizableOption { | ||
id: Int! | ||
label: String! | ||
type: String! | ||
is_required: Int! | ||
values: [SelectedCustomizableOptionValue!]! | ||
sort_order: Int! | ||
} | ||
|
||
type SelectedCustomizableOptionValue { | ||
id: Int! | ||
label: String! | ||
value: String! | ||
price: CartItemSelectedOptionValuePrice! | ||
sort_order: Int! | ||
} | ||
|
||
type CartItemSelectedOptionValuePrice { | ||
value: Float! | ||
units: String! | ||
type: PriceTypeEnum! | ||
} | ||
|
||
input CartItemDetailsInput { | ||
sku: String! | ||
qty: Float! | ||
createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates empty shopping cart for guest or logged in user") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters