mirror of
https://github.com/vercel/commerce.git
synced 2025-09-03 14:30:15 +00:00
.github
.vscode
app
components
contexts
fonts
hooks
lib
shopify
fragments
address.ts
cart.ts
customer-address.ts
customer-details.ts
image.ts
line-item.ts
order-card.ts
order-metafields.ts
order-transaction.ts
order.ts
price.ts
product.ts
seo.ts
mutations
queries
auth.ts
index.ts
types.ts
constants.ts
styles.ts
type-guards.ts
types.ts
utils.ts
public
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
license.md
middleware.ts
next.config.js
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
72 lines
1.4 KiB
TypeScript
72 lines
1.4 KiB
TypeScript
import imageFragment from './image';
|
|
|
|
const cartFragment = /* GraphQL */ `
|
|
fragment cart on Cart {
|
|
id
|
|
checkoutUrl
|
|
attributes {
|
|
key
|
|
value
|
|
}
|
|
cost {
|
|
subtotalAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
totalAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
totalTaxAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
}
|
|
lines(first: 100) {
|
|
edges {
|
|
node {
|
|
id
|
|
quantity
|
|
cost {
|
|
totalAmount {
|
|
amount
|
|
currencyCode
|
|
}
|
|
}
|
|
merchandise {
|
|
... on ProductVariant {
|
|
id
|
|
title
|
|
selectedOptions {
|
|
name
|
|
value
|
|
}
|
|
product {
|
|
featuredImage {
|
|
...image
|
|
}
|
|
handle
|
|
title
|
|
productType
|
|
}
|
|
coreVariantId: metafield(key: "coreVariant", namespace: "custom") {
|
|
value
|
|
}
|
|
addOnQuantity: metafield(namespace: "custom", key: "add_on_quantity") {
|
|
value
|
|
}
|
|
addOnProductId: metafield(namespace: "custom", key: "add_on") {
|
|
value
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
totalQuantity
|
|
}
|
|
${imageFragment}
|
|
`;
|
|
|
|
export default cartFragment;
|