-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #227 from scottyzen/enhancement/fragment-refactoring
Enhancement/fragment refactoring
- Loading branch information
Showing
15 changed files
with
78 additions
and
100 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
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,7 +1,7 @@ | ||
mutation addToCart($input: AddToCartInput!) { | ||
addToCart(input: $input) { | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ mutation applyCoupon($code: String!) { | |
discountAmount | ||
} | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
} | ||
} |
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,7 +1,7 @@ | ||
mutation ChangeShippingMethod($shippingMethods: [String] = "") { | ||
updateShippingMethod(input: { shippingMethods: $shippingMethods }) { | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
} | ||
} |
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,7 +1,7 @@ | ||
mutation EmptyCart { | ||
emptyCart(input: { clearPersistentCart: true }) { | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
} | ||
} |
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,4 +1,4 @@ | ||
fragment CartFragment on Cart { | ||
fragment Cart on Cart { | ||
total | ||
rawTotal: total(format: RAW) | ||
subtotal | ||
|
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,4 +1,4 @@ | ||
fragment CustomerFragment on Customer { | ||
fragment Customer on Customer { | ||
lastName | ||
firstName | ||
|
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 |
---|---|---|
|
@@ -56,6 +56,6 @@ fragment OrderFragment on Order { | |
} | ||
} | ||
customer { | ||
...CustomerFragment | ||
...Customer | ||
} | ||
} |
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,28 +1,36 @@ | ||
query getCart { | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
customer { | ||
...CustomerFragment | ||
...Customer | ||
} | ||
viewer { | ||
lastName | ||
databaseId | ||
id | ||
firstName | ||
username | ||
nicename | ||
wooSessionToken | ||
avatar { | ||
url | ||
} | ||
...Viewer | ||
} | ||
paymentGateways { | ||
nodes { | ||
title | ||
id | ||
description | ||
} | ||
...PaymentGateways | ||
} | ||
} | ||
|
||
fragment Viewer on User { | ||
lastName | ||
databaseId | ||
id | ||
firstName | ||
username | ||
nicename | ||
wooSessionToken | ||
avatar { | ||
url | ||
} | ||
} | ||
|
||
fragment PaymentGateways on RootQueryToPaymentGatewayConnection { | ||
nodes { | ||
title | ||
id | ||
description | ||
} | ||
} |
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,7 +1,7 @@ | ||
mutation registerCustomer($input: RegisterCustomerInput!) { | ||
registerCustomer(input: $input) { | ||
customer { | ||
...CustomerFragment | ||
...Customer | ||
} | ||
} | ||
} |
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,7 +1,7 @@ | ||
mutation removeCoupons($codes: [String]!) { | ||
removeCoupons(input: { codes: $codes }) { | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
} | ||
} |
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,7 +1,7 @@ | ||
mutation UpDateCartQuantity($key: ID!, $quantity: Int!) { | ||
updateItemQuantities(input: { items: { key: $key, quantity: $quantity } }) { | ||
cart { | ||
...CartFragment | ||
...Cart | ||
} | ||
} | ||
} |
Oops, something went wrong.