Files
neuf-www/web/src/lib/news.ts
T

52 lines
885 B
TypeScript

import { graphql } from "@/gql";
import { NewsFragment } from "@/gql/graphql";
export type { NewsFragment, NewsIndexFragment } from "@/gql/graphql";
const NewsFragmentDefinition = graphql(`
fragment News on NewsPage {
__typename
id
slug
seoTitle
searchDescription
title
firstPublishedAt
excerpt
lead
featuredImage {
...Image
}
body {
...Blocks
}
}
`);
const NewsIndexFragmentDefinition = graphql(`
fragment NewsIndex on NewsIndex {
__typename
id
slug
seoTitle
searchDescription
title
lead
}
`);
export const newsQuery = graphql(`
query news {
index: newsIndex {
... on NewsIndex {
...NewsIndex
}
}
news: pages(contentType: "news.NewsPage", order: "-first_published_at", limit: 1000) {
... on NewsPage {
...News
}
}
}
`);