Build a Blog Post Template with GraphQL and Gatsby

Share this video with your friends

Send Tweet

In order to display the generated HTML from a Markdown post, we will build a GraphQL query and pass its data into a Template component that makes use of React’s dangerouslySetInnerHTML API to add a DOM element.

Tony Catalfo
Tony Catalfo
~ 6 years ago

why doesn't this query work in graphiql?

query($pathSlug:String!){
  markdownRemark(frontmatter: {path:{eq:$pathSlug}}){
    html
    frontmatter{
      title
    }
  }
}    
Andrew Alekseev
Andrew Alekseev
~ 6 years ago

style={{fontFamily: 'avenir'}} should be inside h1 tag as:

<h1 style={{fontFamily: 'avenir'}}>