mirror of
https://github.com/vercel/commerce.git
synced 2025-08-06 08:51:25 +00:00
.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
57 lines
1.0 KiB
TypeScript
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;
|