From 0e79c4782c3d32a63a4c62e3a43656b2ca66c016 Mon Sep 17 00:00:00 2001 From: Scott Giminiani Date: Thu, 7 Apr 2022 23:18:10 -0700 Subject: [PATCH] Reference converted yaml id key gatsby-transformer-yaml converts 'id' fields to be 'yamlId' since 'id' is a reserved internal keyword for Gatsby. --- src/templates/tags.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/templates/tags.tsx b/src/templates/tags.tsx index 918676db..32f7ebc5 100644 --- a/src/templates/tags.tsx +++ b/src/templates/tags.tsx @@ -34,7 +34,7 @@ interface TagTemplateProps { allTagYaml: { edges: Array<{ node: { - id: string; + yamlId: string; description: string; image?: any; }; @@ -52,7 +52,7 @@ interface TagTemplateProps { const Tags = ({ pageContext, data, location }: TagTemplateProps) => { const tag = pageContext.tag ? pageContext.tag : ''; const { edges, totalCount } = data.allMarkdownRemark; - const tagData = data.allTagYaml.edges.find(n => n.node.id.toLowerCase() === tag.toLowerCase()); + const tagData = data.allTagYaml.edges.find(n => n.node.yamlId.toLowerCase() === tag.toLowerCase()); return ( @@ -127,7 +127,7 @@ export const pageQuery = graphql` allTagYaml { edges { node { - id + yamlId description image { childImageSharp {