mirror of
https://github.com/vercel/commerce.git
synced 2025-09-01 21:40:14 +00:00
.github
.vscode
app
components
contexts
fonts
hooks
lib
shopify
fragments
mutations
queries
cart.ts
collection.ts
customer.ts
menu.ts
metaobject.ts
node.ts
order.ts
orders.ts
page.ts
product.ts
auth.ts
index.ts
types.ts
constants.ts
styles.ts
type-guards.ts
types.ts
utils.ts
public
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
license.md
middleware.ts
next.config.js
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
46 lines
753 B
TypeScript
46 lines
753 B
TypeScript
import seoFragment from '../fragments/seo';
|
|
|
|
const pageFragment = /* GraphQL */ `
|
|
fragment page on Page {
|
|
... on Page {
|
|
id
|
|
title
|
|
handle
|
|
body
|
|
bodySummary
|
|
seo {
|
|
...seo
|
|
}
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
}
|
|
${seoFragment}
|
|
`;
|
|
|
|
export const getPageQuery = /* GraphQL */ `
|
|
query getPage($handle: String!, $key: String!, $namespace: String) {
|
|
pageByHandle(handle: $handle) {
|
|
...page
|
|
metafield(key: $key, namespace: $namespace) {
|
|
value
|
|
id
|
|
}
|
|
}
|
|
}
|
|
${pageFragment}
|
|
`;
|
|
|
|
export const getPagesQuery = /* GraphQL */ `
|
|
query getPages {
|
|
pages(first: 100) {
|
|
edges {
|
|
node {
|
|
...page
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${pageFragment}
|
|
`;
|