mirror of
https://github.com/vercel/commerce.git
synced 2025-03-27 15:55:54 +00:00
53 lines
989 B
TypeScript
53 lines
989 B
TypeScript
import productFragment from '../fragments/product';
|
|
import seoFragment from '../fragments/seo';
|
|
|
|
const collectionFragment = /* GraphQL */ `
|
|
fragment collection on Collection {
|
|
handle
|
|
title
|
|
description
|
|
seo {
|
|
...seo
|
|
}
|
|
updatedAt
|
|
}
|
|
${seoFragment}
|
|
`;
|
|
|
|
export const getCollectionQuery = /* GraphQL */ `
|
|
query getCollection($handle: String!) {
|
|
collection(handle: $handle) {
|
|
...collection
|
|
}
|
|
}
|
|
${collectionFragment}
|
|
`;
|
|
|
|
export const getCollectionsQuery = /* GraphQL */ `
|
|
query getCollections {
|
|
collections(first: 100, sortKey: TITLE) {
|
|
edges {
|
|
node {
|
|
...collection
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${collectionFragment}
|
|
`;
|
|
|
|
export const getCollectionProductsQuery = /* GraphQL */ `
|
|
query getCollectionProducts($handle: String!) {
|
|
collection(handle: $handle) {
|
|
products(first: 100) {
|
|
edges {
|
|
node {
|
|
...product
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${productFragment}
|
|
`;
|