refactor(starter): upgrade to new version of gatsby

This commit is contained in:
Alexander Shelepenok
2022-01-09 20:12:31 +00:00
parent 84bdc5899d
commit 67ebabbaac
397 changed files with 26665 additions and 34984 deletions

View File

@@ -0,0 +1,29 @@
import { CreatePagesArgs } from "gatsby";
import * as types from "../types";
export interface PostsQueryResult {
allMarkdownRemark: {
edges?: Array<types.Edge>;
};
}
const postsQuery = async (graphql: CreatePagesArgs["graphql"]) => {
const result = await graphql<PostsQueryResult>(`
{
allMarkdownRemark(filter: { frontmatter: { draft: { ne: true } } }) {
edges {
node {
fields {
slug
}
}
}
}
}
`);
return result?.data?.allMarkdownRemark;
};
export default postsQuery;