mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
wip: Saving work
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import cartFragment from '../fragments/cart';
|
||||
|
||||
export const addToCartMutation = /* GraphQL */ `
|
||||
mutation addToCart($cartId: ID!, $lines: [CartLineInput!]!) {
|
||||
mutation addToCart(
|
||||
$cartId: ID!
|
||||
$lines: [CartLineInput!]!
|
||||
$country: CountryCode
|
||||
$language: LanguageCode
|
||||
) @inContext($country: String, $language: String) {
|
||||
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
||||
cart {
|
||||
...cart
|
||||
@@ -12,7 +17,11 @@ export const addToCartMutation = /* GraphQL */ `
|
||||
`;
|
||||
|
||||
export const createCartMutation = /* GraphQL */ `
|
||||
mutation createCart($lineItems: [CartLineInput!]) {
|
||||
mutation createCart(
|
||||
$lineItems: [CartLineInput!],
|
||||
$country: CountryCode,
|
||||
$language: LanguageCode
|
||||
) @inContext($country: String, $language: String) {
|
||||
cartCreate(input: { lines: $lineItems }) {
|
||||
cart {
|
||||
...cart
|
||||
@@ -23,7 +32,8 @@ export const createCartMutation = /* GraphQL */ `
|
||||
`;
|
||||
|
||||
export const editCartItemsMutation = /* GraphQL */ `
|
||||
mutation editCartItems($cartId: ID!, $lines: [CartLineUpdateInput!]!) {
|
||||
mutation editCartItems($cartId: ID!, $lines: [CartLineUpdateInput!]!, $country: CountryCode, $language: LanguageCode)
|
||||
@inContext($country: String, $language: String) {
|
||||
cartLinesUpdate(cartId: $cartId, lines: $lines) {
|
||||
cart {
|
||||
...cart
|
||||
@@ -34,7 +44,8 @@ export const editCartItemsMutation = /* GraphQL */ `
|
||||
`;
|
||||
|
||||
export const removeFromCartMutation = /* GraphQL */ `
|
||||
mutation removeFromCart($cartId: ID!, $lineIds: [ID!]!) {
|
||||
mutation removeFromCart($cartId: ID!, $lineIds: [ID!]!, $country: CountryCode, $language: LanguageCode)
|
||||
@inContext($country: String, $language: String) {
|
||||
cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
|
||||
cart {
|
||||
...cart
|
||||
|
Reference in New Issue
Block a user