mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
68 lines
1.1 KiB
TypeScript
68 lines
1.1 KiB
TypeScript
export const catalogItemsConnection = `
|
|
pageInfo {
|
|
hasNextPage
|
|
hasPreviousPage
|
|
}
|
|
edges {
|
|
node {
|
|
_id
|
|
... on CatalogItemProduct {
|
|
product {
|
|
_id
|
|
title
|
|
slug
|
|
description
|
|
vendor
|
|
isLowQuantity
|
|
isSoldOut
|
|
isBackorder
|
|
shop {
|
|
currency {
|
|
code
|
|
}
|
|
}
|
|
pricing {
|
|
currency {
|
|
code
|
|
}
|
|
displayPrice
|
|
minPrice
|
|
maxPrice
|
|
}
|
|
primaryImage {
|
|
URLs {
|
|
thumbnail
|
|
small
|
|
medium
|
|
large
|
|
original
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`
|
|
|
|
export const catalogItemsFragment = `
|
|
catalogItems(
|
|
first: $first
|
|
sortBy: $sortBy
|
|
tagIds: $tagIds
|
|
shopIds: $shopIds
|
|
) {
|
|
${catalogItemsConnection}
|
|
}
|
|
`
|
|
|
|
const catalogItemsQuery = /* GraphQL */ `
|
|
query catalogItems(
|
|
$first: ConnectionLimitInt = 250
|
|
$sortBy: CatalogItemSortByField = updatedAt
|
|
$tagIds: [ID]
|
|
$shopIds: [ID]!
|
|
) {
|
|
${catalogItemsFragment}
|
|
}
|
|
`
|
|
export default catalogItemsQuery
|