mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 04:01:21 +00:00
85 lines
1.5 KiB
TypeScript
85 lines
1.5 KiB
TypeScript
export const cartDetailsFragment = /* GraphQL */ `
|
|
fragment cartDetails on Cart {
|
|
id
|
|
checkoutUrl
|
|
createdAt
|
|
updatedAt
|
|
lines(first: 10) {
|
|
edges {
|
|
node {
|
|
id
|
|
quantity
|
|
merchandise {
|
|
... on ProductVariant {
|
|
id
|
|
id
|
|
sku
|
|
title
|
|
selectedOptions {
|
|
name
|
|
value
|
|
}
|
|
image {
|
|
originalSrc
|
|
altText
|
|
width
|
|
height
|
|
}
|
|
priceV2 {
|
|
amount
|
|
currencyCode
|
|
}
|
|
compareAtPriceV2 {
|
|
amount
|
|
currencyCode
|
|
}
|
|
product {
|
|
title
|
|
handle
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
attributes {
|
|
key
|
|
value
|
|
}
|
|
buyerIdentity {
|
|
email
|
|
customer {
|
|
id
|
|
}
|
|
}
|
|
estimatedCost {
|
|
totalAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
subtotalAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
totalTaxAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
totalDutyAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
const getCartQuery = /* GraphQL */ `
|
|
query getCart($cartId: ID!) {
|
|
cart(id: $cartId) {
|
|
...cartDetails
|
|
}
|
|
}
|
|
${cartDetailsFragment}
|
|
`
|
|
export default getCartQuery
|