mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-26 14:59:14 +01:00
26 lines
467 B
TypeScript
26 lines
467 B
TypeScript
import { CreatePagesArgs } from "gatsby";
|
|
|
|
interface MetadataQueryResult {
|
|
site: {
|
|
siteMetadata: {
|
|
postsLimit?: number;
|
|
};
|
|
};
|
|
}
|
|
|
|
const metadataQuery = async (graphql: CreatePagesArgs["graphql"]) => {
|
|
const result = await graphql<MetadataQueryResult>(`
|
|
query SiteMetaData {
|
|
site {
|
|
siteMetadata {
|
|
postsLimit
|
|
}
|
|
}
|
|
}
|
|
`);
|
|
|
|
return result?.data?.site.siteMetadata ?? {};
|
|
};
|
|
|
|
export default metadataQuery;
|