mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import productFragment from '../fragments/product';
|
|
|
|
export const getProductQuery = /* GraphQL */ `
|
|
query getProduct($handle: String!, $country: CountryCode, $language: LanguageCode)
|
|
@inContext(country: $country, language: $language) {
|
|
product(handle: $handle) {
|
|
...product
|
|
}
|
|
}
|
|
${productFragment}
|
|
`;
|
|
|
|
export const getProductsQuery = /* GraphQL */ `
|
|
query getProducts(
|
|
$sortKey: ProductSortKeys
|
|
$reverse: Boolean
|
|
$query: String
|
|
$country: CountryCode
|
|
$language: LanguageCode
|
|
) @inContext(country: $country, language: $language) {
|
|
products(sortKey: $sortKey, reverse: $reverse, query: $query, first: 100) {
|
|
edges {
|
|
node {
|
|
...product
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${productFragment}
|
|
`;
|
|
|
|
export const getProductRecommendationsQuery = /* GraphQL */ `
|
|
query getProductRecommendations($productId: ID!, $country: CountryCode, $language: LanguageCode)
|
|
@inContext(country: $country, language: $language) {
|
|
productRecommendations(productId: $productId) {
|
|
...product
|
|
}
|
|
}
|
|
${productFragment}
|
|
`;
|