Skip to content

Commit 0d1f9ef

Browse files
author
al.kravchuk
committed
Actualize the Graphqls schema with the latest variation.
1 parent 3bda364 commit 0d1f9ef

File tree

1 file changed

+52
-36
lines changed

1 file changed

+52
-36
lines changed
Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
1-
type Query {
2-
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput
1+
type Mutation {
32
setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput
3+
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput
44
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput
55
}
66

77
input SetShippingMethodsOnCartInput {
8-
shipping_methods: [ShippingMethodForAddressInput!]!
8+
cart_id: String!
9+
shipping_methods: [ShippingMethodInput!]!
910
}
1011

11-
input ShippingMethodForAddressInput {
12-
cart_address_id: String!
13-
shipping_method_code: String!
12+
input ShippingMethodInput {
13+
carrier_code: String!
14+
method_code: String!
1415
}
1516

1617
input SetBillingAddressOnCartInput {
18+
cart_id: String!
19+
billing_address: BillingAddressInput!
20+
}
21+
22+
input BillingAddressInput {
1723
customer_address_id: Int
1824
address: CartAddressInput
25+
use_for_shipping: Boolean
1926
}
2027

2128
input SetShippingAddressesOnCartInput {
22-
customer_address_id: Int # Can be provided in one-page checkout and is required for multi-shipping checkout
23-
address: CartAddressInput
24-
cart_items: [CartItemQuantityInput!]
29+
cart_id: String!
30+
shipping_addresses: [ShippingAddressInput!]!
2531
}
2632

27-
input CartItemQuantityInput {
28-
cart_item_id: String!
29-
quantity: Float!
33+
input ShippingAddressInput {
34+
customer_address_id: Int # If provided then will be used address from address book
35+
address: CartAddressInput
3036
}
3137

3238
input CartAddressInput {
@@ -55,32 +61,33 @@ type SetBillingAddressOnCartOutput {
5561
}
5662

5763
type Cart {
58-
addresses: [CartAddress]!
64+
shipping_addresses: [ShippingCartAddress]!
65+
billing_address: BillingCartAddress!
5966
}
6067

61-
type CartAddress {
62-
firstname: String!
63-
lastname: String!
68+
interface CartAddressInterface {
69+
firstname: String
70+
lastname: String
6471
company: String
65-
street: [String!]!
66-
city: String!
72+
street: [String]
73+
city: String
6774
region: CartAddressRegion
6875
postcode: String
69-
country: CartAddressCountry!
70-
telephone: String!
71-
address_type: AdressTypeEnum!
72-
73-
selected_shipping_method: CheckoutShippingMethod
74-
available_shipping_methods: [CheckoutShippingMethod]!
75-
76-
items_weight: Float
76+
country: CartAddressCountry
77+
telephone: String
7778
customer_notes: String
78-
gift_cards_amount_used: Money
79-
applied_gift_cards: [CartGiftCard]
79+
}
8080

81+
type ShippingCartAddress implements CartAddressInterface {
82+
available_shipping_methods: [AvailableShippingMethod]
83+
selected_shipping_method: SelectedShippingMethod
84+
items_weight: Float
8185
cart_items: [CartItemQuantity]
8286
}
8387

88+
type BillingCartAddress implements CartAddressInterface {
89+
}
90+
8491
type CartItemQuantity {
8592
cart_item_id: String!
8693
quantity: Float!
@@ -96,15 +103,24 @@ type CartAddressRegion {
96103
label: String
97104
}
98105

99-
enum AdressTypeEnum {
100-
SHIPPING
101-
BILLING
106+
type SelectedShippingMethod {
107+
carrier_code: String
108+
method_code: String
109+
carrier_title: String
110+
method_title: String
111+
amount: Money
112+
base_amount: Money
102113
}
103114

104-
type CheckoutShippingMethod {
105-
code: String
106-
label: String
107-
free_shipping: Boolean!
115+
type AvailableShippingMethod {
116+
carrier_code: String!
117+
carrier_title: String!
118+
method_code: String
119+
method_title: String
108120
error_message: String
109-
# TODO: Add more complex structure for shipping rates
121+
amount: Money!
122+
base_amount: Money
123+
price_excl_tax: Money!
124+
price_incl_tax: Money!
125+
available: Boolean!
110126
}

0 commit comments

Comments
 (0)