Build a Blog Post Template with GraphQL and Gatsby

InstructorTaylor Bell

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
~ 5 years ago

why doesn't this query work in graphiql?

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

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

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