Skip to content

Commit 05c34b7

Browse files
authored
Merge pull request #6 from vtex-apps/feature/shipping-info
Feature/shipping info
2 parents 9353767 + 32b02d5 commit 05c34b7

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## Added
11+
12+
- `Address` fragment to `OrderForm`.
13+
14+
## Added
15+
16+
- Shipping info to `OrderForm` fragment.
17+
- `EstimateShipping` mutation.
18+
1019
## [0.5.0] - 2019-09-23
1120

1221
### Added

react/Mutations.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import estimateShipping from './mutations/estimateShipping.graphql'
12
import insertCoupon from './mutations/insertCoupon.graphql'
23
import updateItems from './mutations/updateItems.graphql'
34

45
export default {
56
insertCoupon,
7+
estimateShipping,
68
updateItems,
79
}

react/fragments/address.graphql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
fragment Address on Address {
2+
addressId
3+
addressType
4+
city
5+
complement
6+
country
7+
neighborhood
8+
number
9+
postalCode
10+
receiverName
11+
reference
12+
state
13+
street
14+
}

react/fragments/orderForm.graphql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#import './address.graphql'
2+
13
fragment OrderFormFragment on OrderForm {
24
items {
35
additionalInfo {
@@ -29,6 +31,15 @@ fragment OrderFormFragment on OrderForm {
2931
name
3032
value
3133
}
34+
shipping {
35+
countries
36+
availableAddresses {
37+
...Address
38+
}
39+
selectedAddress {
40+
...Address
41+
}
42+
}
3243
messages {
3344
couponMessages {
3445
code
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# import '../fragments/orderForm.graphql'
2+
3+
mutation estimateShipping($addressInput: AddressInput) {
4+
estimateShipping(address: $addressInput)
5+
@context(provider: "vtex.checkout-graphql") {
6+
...OrderFormFragment
7+
}
8+
}

0 commit comments

Comments
 (0)