diff --git a/.gitignore b/.gitignore index e5507981b2..450b61eb79 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ yarn-error.log # Swap files *.swp + +# Codegen stuff +src/__generated__/ diff --git a/gatsby-config.js b/gatsby-config.js index 8fd1db2319..b805dbe0ab 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -115,5 +115,11 @@ module.exports = { ], }, }, + { + resolve: "gatsby-plugin-typegen", + options: { + outputPath: "src/__generated__/gatsby-types.d.ts", + }, + }, ], } diff --git a/package.json b/package.json index 5e0a005e56..09e4d44bcd 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "clean": "gatsby clean", "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" }, + "resolutions": { + "graphql": "15.6.0" + }, "dependencies": { "@graphql-tools/schema": "8.2.0", "@weknow/gatsby-remark-twitter": "0.2.3", @@ -23,6 +26,7 @@ "gatsby-plugin-google-analytics": "3.14.0", "gatsby-plugin-less": "5.14.0", "gatsby-plugin-react-helmet": "4.14.0", + "gatsby-plugin-typegen": "^2.2.4", "gatsby-plugin-webfonts": "2.1.1", "gatsby-source-filesystem": "3.14.0", "gatsby-transformer-remark": "4.11.0", diff --git a/src/components/BlogSidebar/index.tsx b/src/components/BlogSidebar/index.tsx index 1a828527ec..3a0cb7efbd 100644 --- a/src/components/BlogSidebar/index.tsx +++ b/src/components/BlogSidebar/index.tsx @@ -7,7 +7,7 @@ interface Props { } const BlogSidebar = ({ posts, currentPermalink }: Props) => { - const allTags = useStaticQuery(graphql` + const allTags = useStaticQuery(graphql` query allTags { allMarkdownRemark { group(field: frontmatter___tags) { @@ -28,7 +28,7 @@ const BlogSidebar = ({ posts, currentPermalink }: Props) => {

Categories