-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebase and use graphql invoker in add item to cart
- Loading branch information
Showing
5 changed files
with
123 additions
and
44 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
29 changes: 29 additions & 0 deletions
29
packages/venia-ui/lib/queries/addConfigurableProductsToCart.graphql
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
mutation addConfigurableProductToCart( | ||
$cartId: String! | ||
$quantity: Float! | ||
$sku: String! | ||
$parentSku: String! | ||
) { | ||
addConfigurableProductsToCart( | ||
input: { | ||
cart_id: $cartId | ||
cart_items: [ | ||
{ | ||
data: { quantity: $quantity, sku: $sku } | ||
parent_sku: $parentSku | ||
} | ||
] | ||
} | ||
) { | ||
cart { | ||
items { | ||
id | ||
product { | ||
name | ||
sku | ||
} | ||
quantity | ||
} | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/venia-ui/lib/queries/addSimpleProductsToCart.graphql
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
mutation addSimpleProductToCart( | ||
$cartId: String! | ||
$quantity: Float! | ||
$sku: String! | ||
) { | ||
addSimpleProductsToCart( | ||
input: { | ||
cart_id: $cartId | ||
cart_items: [{ data: { quantity: $quantity, sku: $sku } }] | ||
} | ||
) { | ||
cart { | ||
items { | ||
id | ||
product { | ||
name | ||
sku | ||
} | ||
quantity | ||
} | ||
} | ||
} | ||
} |