mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-27 15:28:43 +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;
|