Created
February 14, 2019 15:45
-
-
Save yanns/98f0751094090c198ebd9be39cb9fcf0 to your computer and use it in GitHub Desktop.
checkout 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
mutation CreateCart { | |
createCart(draft: { | |
currency: "USD" | |
origin: Customer | |
lineItems: [ | |
{ | |
productId: "<product-id>" | |
variantId: 1 | |
} | |
] | |
}) { | |
id | |
version | |
origin | |
lineItems { | |
productId | |
variant { | |
id | |
} | |
} | |
} | |
} | |
mutation UpdateCart($$id: String!) { | |
updateCart( | |
id: $$id | |
version: 1 | |
actions: [ | |
{ setCustomerEmail: { email: "my-email@bar.com" } } | |
{ setShippingAddress: { address: { country: "US" } } } | |
] | |
) { | |
version | |
} | |
} | |
mutation { | |
createOrderFromCart(draft: { | |
id : "<cart-id>" | |
version : 1 | |
}) { | |
id | |
country | |
origin | |
shippingAddress { | |
country | |
} | |
lineItems { | |
id | |
productId | |
name (locale: "en") | |
quantity | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment