-
Notifications
You must be signed in to change notification settings - Fork 9.3k
/
Copy pathschema.graphqls
329 lines (272 loc) · 9.33 KB
/
schema.graphqls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# 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(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")
placeOrder(input: PlaceOrderInput): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder")
}
input createEmptyCartInput {
cart_id: String
}
input AddSimpleProductsToCartInput {
cart_id: String!
cartItems: [SimpleProductCartItemInput!]!
}
input SimpleProductCartItemInput {
data: CartItemInput!
customizable_options:[CustomizableOptionInput!]
}
input AddVirtualProductsToCartInput {
cart_id: String!
cartItems: [VirtualProductCartItemInput!]!
}
input VirtualProductCartItemInput {
data: CartItemInput!
customizable_options:[CustomizableOptionInput!]
}
input CartItemInput {
sku: String!
qty: Float!
}
input CustomizableOptionInput {
id: Int!
value: String!
}
input ApplyCouponToCartInput {
cart_id: String!
coupon_code: String!
}
input UpdateCartItemsInput {
cart_id: String!
cart_items: [CartItemQuantityInput!]!
}
input CartItemQuantityInput {
cart_item_id: Int!
quantity: Float!
}
input RemoveItemFromCartInput {
cart_id: String!
cart_item_id: Int!
}
input SetShippingAddressesOnCartInput {
cart_id: String!
shipping_addresses: [ShippingAddressInput!]!
}
input ShippingAddressInput {
customer_address_id: Int # If provided then will be used address from address book
address: CartAddressInput
}
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: [ShippingMethodInput!]!
}
input ShippingMethodInput {
cart_address_id: Int!
carrier_code: String!
method_code: String!
}
input PlaceOrderInput {
cart_id: String!
}
input SetPaymentMethodOnCartInput {
cart_id: String!
payment_method: PaymentMethodInput!
}
input PaymentMethodInput {
code: String! @doc(description:"Payment method code")
purchase_order_number: String @doc(description:"Purchase order number")
}
input SetGuestEmailOnCartInput {
cart_id: String!
email: String!
}
type CartPrices {
grand_total: Money
subtotal_including_tax: Money
subtotal_excluding_tax: Money
subtotal_with_discount_excluding_tax: Money
applied_taxes: [CartTaxItem]
}
type CartTaxItem {
amount: Money!
label: String!
}
type SetPaymentMethodOnCartOutput {
cart: Cart!
}
type SetBillingAddressOnCartOutput {
cart: Cart!
}
type SetShippingAddressesOnCartOutput {
cart: Cart!
}
type SetShippingMethodsOnCartOutput {
cart: Cart!
}
type ApplyCouponToCartOutput {
cart: Cart!
}
type PlaceOrderOutput {
order: Order!
}
type Cart {
items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems")
applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon")
email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail")
shipping_addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses")
billing_address: CartAddress! @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")
}
type CartAddress {
address_id: Int
firstname: String
lastname: String
company: String
street: [String]
city: String
region: CartAddressRegion
postcode: String
country: CartAddressCountry
telephone: String
address_type: AdressTypeEnum
available_shipping_methods: [AvailableShippingMethod] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\AvailableShippingMethods")
selected_shipping_method: SelectedShippingMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\SelectedShippingMethod")
items_weight: Float
customer_notes: String
cart_items: [CartItemQuantity]
}
type CartItemQuantity {
cart_item_id: Int!
quantity: Float!
}
type CartAddressRegion {
code: String
label: String
}
type CartAddressCountry {
code: String
label: String
}
type SelectedShippingMethod {
carrier_code: String
method_code: String
label: String
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!
}
type AvailablePaymentMethod {
code: String @doc(description: "The payment method code")
title: String @doc(description: "The payment method title.")
}
type SelectedPaymentMethod {
code: String @doc(description: "The payment method code")
purchase_order_number: String @doc(description: "The purchase order number.")
}
enum AdressTypeEnum {
SHIPPING
BILLING
}
type AppliedCoupon {
code: String!
}
input RemoveCouponFromCartInput {
cart_id: String!
}
type RemoveCouponFromCartOutput {
cart: Cart
}
type AddSimpleProductsToCartOutput {
cart: Cart!
}
type AddVirtualProductsToCartOutput {
cart: Cart!
}
type UpdateCartItemsOutput {
cart: Cart!
}
type RemoveItemFromCartOutput {
cart: Cart!
}
type SetGuestEmailOnCartOutput {
cart: Cart!
}
type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") {
customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions")
}
type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Cart Item") {
customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions")
}
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!
}
type Order {
order_id: String
}