saleor: initial cart integration

This commit is contained in:
Zaiste
2021-04-26 16:24:50 +02:00
parent ef10084e54
commit 19445747f1
9 changed files with 41 additions and 76 deletions

View File

@@ -1,61 +1,11 @@
export const checkoutDetailsFragment = `
id
webUrl
subtotalPriceV2{
amount
currencyCode
}
totalTaxV2 {
amount
currencyCode
}
totalPriceV2 {
amount
currencyCode
}
completedAt
createdAt
taxesIncluded
lineItems(first: 250) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
node {
id
title
variant {
id
sku
title
image {
originalSrc
altText
width
height
}
priceV2{
amount
currencyCode
}
compareAtPriceV2{
amount
currencyCode
}
product {
handle
}
}
quantity
}
}
}
token
`
const getCheckoutQuery = /* GraphQL */ `
query($checkoutId: ID!) {
node(id: $checkoutId) {
query($checkoutId: UUID!) {
checkout(token: $checkoutId) {
... on Checkout {
${checkoutDetailsFragment}
}