mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 07:56:59 +00:00
25 lines
562 B
TypeScript
25 lines
562 B
TypeScript
import { catalogItemsConnection } from './catalog-items-query'
|
|
|
|
const getCollectionProductsQuery = /* GraphQL */ `
|
|
query getProductsFromCollection(
|
|
$categoryId: ID!
|
|
$first: Int = 250
|
|
$sortKey: ProductCollectionSortKeys = RELEVANCE
|
|
$reverse: Boolean = false
|
|
) {
|
|
node(id: $categoryId) {
|
|
id
|
|
... on Collection {
|
|
products(
|
|
first: $first
|
|
sortKey: $sortKey
|
|
reverse: $reverse
|
|
) {
|
|
${catalogItemsConnection}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
export default getCollectionProductsQuery
|