lib/shopify: add collection names to product query fragment

This commit is contained in:
andr-ew 2023-06-21 14:46:32 -05:00
parent f54c0cfe65
commit 087c5ecb93

View File

@ -2,63 +2,69 @@ import imageFragment from './image';
import seoFragment from './seo'; import seoFragment from './seo';
const productFragment = /* GraphQL */ ` const productFragment = /* GraphQL */ `
fragment product on Product { fragment product on Product {
id id
handle handle
availableForSale availableForSale
title title
description description
descriptionHtml descriptionHtml
options { options {
id id
name
values
}
priceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
amount
currencyCode
}
}
variants(first: 250) {
edges {
node {
id
title
availableForSale
selectedOptions {
name name
value values
}
price {
amount
currencyCode
}
} }
} priceRange {
} maxVariantPrice {
featuredImage { amount
...image currencyCode
} }
images(first: 20) { minVariantPrice {
edges { amount
node { currencyCode
...image }
}
variants(first: 250) {
edges {
node {
id
title
availableForSale
selectedOptions {
name
value
}
price {
amount
currencyCode
}
}
}
}
featuredImage {
...image
}
images(first: 99) {
edges {
node {
...image
}
}
}
seo {
...seo
}
tags
updatedAt
collections(first: 99) {
nodes {
handle
title
}
} }
}
} }
seo { ${imageFragment}
...seo ${seoFragment}
}
tags
updatedAt
}
${imageFragment}
${seoFragment}
`; `;
export default productFragment; export default productFragment;