mirror of
https://github.com/vercel/commerce.git
synced 2025-07-31 22:11:24 +00:00
.github
.vscode
app
components
e2e
lib
medusa
shopify
fragments
mutations
queries
cart.ts
collection.ts
menu.ts
page.ts
product.ts
index.ts
types.ts
constants.tsx
type-guards.ts
utils.ts
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
license.md
next.config.js
package.json
playwright.config.ts
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
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}
|
|
`;
|