Chloe e0cd6ac2bd
feat: add metafields to variant options
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
2024-05-03 12:28:37 +07:00

91 lines
1.7 KiB
TypeScript

import imageFragment from './image';
import seoFragment from './seo';
const productFragment = /* GraphQL */ `
fragment product on Product {
id
handle
availableForSale
title
description
descriptionHtml
options {
id
name
values
}
priceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
amount
currencyCode
}
}
collections(first: 1) {
nodes {
title
handle
}
}
variants(first: 250) {
edges {
node {
id
title
availableForSale
barcode
sku
selectedOptions {
name
value
}
price {
amount
currencyCode
}
coreCharge: metafield(namespace: "custom", key: "core_charge") {
value
}
waiverAvailable: metafield(namespace: "custom", key: "waiver_available") {
value
}
coreVariantId: metafield(namespace: "custom", key: "coreVariant") {
value
}
estimatedDelivery: metafield(namespace: "custom", key: "delivery") {
value
}
mileage: metafield(namespace: "custom", key: "mileage") {
value
}
condition: metafield(namespace: "custom", key: "condition") {
value
}
}
}
}
featuredImage {
...image
}
images(first: 20) {
edges {
node {
...image
}
}
}
seo {
...seo
}
tags
updatedAt
}
${imageFragment}
${seoFragment}
`;
export default productFragment;