1
0
mirror of https://github.com/vercel/commerce.git synced 2025-08-06 08:51:25 +00:00
Files
.github
.vscode
app
components
fonts
hooks
lib
shopify
fragments
cart.ts
image.ts
product.ts
seo.ts
mutations
queries
index.ts
types.ts
constants.ts
styles.ts
type-guards.ts
utils.ts
public
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
license.md
next.config.js
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
commerce/lib/shopify/fragments/cart.ts
2024-06-12 10:20:28 +07:00

57 lines
1.0 KiB
TypeScript

import productFragment from './product';
const cartFragment = /* GraphQL */ `
fragment cart on Cart {
id
checkoutUrl
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 {
...product
}
coreVariantId: metafield(key: "coreVariant", namespace: "custom") {
value
}
}
}
}
}
}
totalQuantity
}
${productFragment}
`;
export default cartFragment;