|
1 | 1 | # Copyright © Magento, Inc. All rights reserved. |
2 | 2 | # See COPYING.txt for license details. |
3 | 3 |
|
4 | | -type Query { |
5 | | - cart(cart_id: String!): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Returns information about shopping cart") |
6 | | -} |
7 | | - |
8 | 4 | type Mutation { |
9 | | - createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates an empty shopping cart for a guest or logged in user") |
10 | | - applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\ApplyCouponToCart") |
11 | | - removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\RemoveCouponFromCart") |
12 | | - setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart") |
13 | | - applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart") |
14 | | - removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart") |
15 | | - setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart") |
16 | | - setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart") |
17 | | - addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") |
18 | | -} |
19 | | - |
20 | | -input SetShippingAddressesOnCartInput { |
21 | | - cart_id: String! |
22 | | - shipping_addresses: [ShippingAddressInput!]! |
23 | | -} |
24 | | - |
25 | | -input ShippingAddressInput { |
26 | | - customer_address_id: Int # Can be provided in one-page checkout and is required for multi-shipping checkout |
27 | | - address: CartAddressInput |
28 | | - cart_items: [CartItemQuantityInput!] |
29 | | -} |
30 | | - |
31 | | -input CartItemQuantityInput { |
32 | | - cart_item_id: Int! |
33 | | - quantity: Float! |
34 | | -} |
35 | | - |
36 | | -input SetBillingAddressOnCartInput { |
37 | | - cart_id: String! |
38 | | - billing_address: BillingAddressInput! |
39 | | -} |
40 | | - |
41 | | -input BillingAddressInput { |
42 | | - customer_address_id: Int |
43 | | - address: CartAddressInput |
44 | | - use_for_shipping: Boolean |
45 | | -} |
46 | | - |
47 | | -input CartAddressInput { |
48 | | - firstname: String! |
49 | | - lastname: String! |
50 | | - company: String |
51 | | - street: [String!]! |
52 | | - city: String! |
53 | | - region: String |
54 | | - postcode: String |
55 | | - country_code: String! |
56 | | - telephone: String! |
57 | | - save_in_address_book: Boolean! |
58 | | -} |
59 | | - |
60 | | -input SetShippingMethodsOnCartInput { |
61 | | - cart_id: String! |
62 | | - shipping_methods: [ShippingMethodForAddressInput!]! |
63 | | -} |
64 | | - |
65 | | -input ShippingMethodForAddressInput { |
66 | | - cart_address_id: Int! |
67 | | - carrier_code: String! |
68 | | - method_code: String! |
69 | | -} |
70 | | - |
71 | | -type SetBillingAddressOnCartOutput { |
72 | | - cart: Cart! |
73 | | -} |
74 | | - |
75 | | -type SetShippingAddressesOnCartOutput { |
76 | | - cart: Cart! |
77 | | -} |
78 | | - |
79 | | -type SetShippingMethodsOnCartOutput { |
80 | | - cart: Cart! |
81 | | -} |
82 | | - |
83 | | -# If no address is provided, the system get address assigned to a quote |
84 | | -# If there's no address at all - the system returns all shipping methods |
85 | | -input AvailableShippingMethodsOnCartInput { |
86 | | - cart_id: String! |
87 | | - customer_address_id: Int |
88 | | - address: CartAddressInput |
89 | | -} |
90 | | - |
91 | | -input ApplyCouponToCartInput { |
92 | | - cart_id: String! |
93 | | - coupon_code: String! |
94 | | -} |
95 | | - |
96 | | -type ApplyCouponToCartOutput { |
97 | | - cart: Cart! |
98 | | -} |
99 | | - |
100 | | -type Cart { |
101 | | - cart_id: String |
102 | | - items: [CartItemInterface] |
103 | | - applied_coupon: AppliedCoupon |
104 | | - shipping_addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") |
105 | | - billing_address: CartAddress! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") |
106 | | -} |
107 | | - |
108 | | -type CartAddress { |
109 | | - firstname: String |
110 | | - lastname: String |
111 | | - company: String |
112 | | - street: [String] |
113 | | - city: String |
114 | | - region: CartAddressRegion |
115 | | - postcode: String |
116 | | - country: CartAddressCountry |
117 | | - telephone: String |
118 | | - address_type: AdressTypeEnum |
119 | | - items_weight: Float |
120 | | - customer_notes: String |
121 | | - cart_items: [CartItemQuantity] |
122 | | -} |
123 | | - |
124 | | -type CartItemQuantity { |
125 | | - cart_item_id: String! |
126 | | - quantity: Float! |
127 | | -} |
128 | | - |
129 | | -type CartAddressRegion { |
130 | | - code: String |
131 | | - label: String |
132 | | -} |
133 | | - |
134 | | -type CartAddressCountry { |
135 | | - code: String |
136 | | - label: String |
137 | | -} |
138 | | - |
139 | | -type SelectedShippingMethod { |
140 | | - amount: Float! |
141 | | -} |
142 | | - |
143 | | -type AvailableShippingMethod { |
144 | | - carrier_code: String! |
145 | | - carrier_title: String! |
146 | | - method_code: String! |
147 | | - method_title: String! |
148 | | - error_message: String |
149 | | - amount: Float! |
150 | | - base_amount: Float! |
151 | | - price_excl_tax: Float! |
152 | | - price_incl_tax: Float! |
153 | | -} |
154 | | - |
155 | | -enum AdressTypeEnum { |
156 | | - SHIPPING |
157 | | - BILLING |
158 | | -} |
159 | | - |
160 | | -type AppliedCoupon { |
161 | | - code: String! |
162 | | -} |
163 | | - |
164 | | -input RemoveCouponFromCartInput { |
165 | | - cart_id: String! |
166 | | -} |
167 | | - |
168 | | -type RemoveCouponFromCartOutput { |
169 | | - cart: Cart |
170 | | -} |
171 | | - |
172 | | -input AddSimpleProductsToCartInput { |
173 | | - cart_id: String! |
174 | | - cartItems: [SimpleProductCartItemInput!]! |
175 | | -} |
176 | | - |
177 | | -input SimpleProductCartItemInput { |
178 | | - data: CartItemInput! |
179 | | - customizable_options:[CustomizableOptionInput!] |
180 | | -} |
181 | | - |
182 | | -input CustomizableOptionInput { |
183 | | - id: Int! |
184 | | - value: String! |
185 | | -} |
186 | | - |
187 | | -type AddSimpleProductsToCartOutput { |
188 | | - cart: Cart! |
189 | | -} |
190 | | - |
191 | | -type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") { |
192 | | - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") |
193 | | -} |
194 | | - |
195 | | -input CartItemInput { |
196 | | - sku: String! |
197 | | - qty: Float! |
198 | | -} |
199 | | - |
200 | | -interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { |
201 | | - id: String! |
202 | | - qty: Float! |
203 | | - product: ProductInterface! |
204 | | -} |
205 | | - |
206 | | -type SelectedCustomizableOption { |
207 | | - id: Int! |
208 | | - label: String! |
209 | | - type: String! |
210 | | - is_required: Int! |
211 | | - values: [SelectedCustomizableOptionValue!]! |
212 | | - sort_order: Int! |
213 | | -} |
214 | | - |
215 | | -type SelectedCustomizableOptionValue { |
216 | | - id: Int! |
217 | | - label: String! |
218 | | - value: String! |
219 | | - price: CartItemSelectedOptionValuePrice! |
220 | | - sort_order: Int! |
221 | | -} |
222 | | - |
223 | | -type CartItemSelectedOptionValuePrice { |
224 | | - value: Float! |
225 | | - units: String! |
226 | | - type: PriceTypeEnum! |
227 | | -} |
228 | | - |
229 | | -input CartItemDetailsInput { |
230 | | - sku: String! |
231 | | - qty: Float! |
| 5 | + createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates empty shopping cart for guest or logged in user") |
232 | 6 | } |
0 commit comments