FrontendMasters / gatsby-intro

Code for the Introduction to Gatsby course.
https://frontendmasters.com/courses/gatsby/
MIT License
253 stars 235 forks source link

mdx graphql query structure doesn't have "code" #26

Closed davinakano closed 4 years ago

davinakano commented 5 years ago

Hi 👋

First of all, fantastic course! So far, I have been enjoying a lot. Kudos!

I have been following the course but got a little bit stuck in the following video: https://frontendmasters.com/courses/gatsby/getting-post-data-by-slug/

Turns out that instead of

query($slug: String!) {
    mdx(frontmatter: { slug: { eq: $slug } }) {
      frontmatter {
        title
        author
      }
      code {
        body
      }
    }
  }

I had to use:

query($slug: String!) {
    mdx(frontmatter: { slug: { eq: $slug } }) {
      frontmatter {
        title
        author
      }
      body
    }
  }

Seems that there's no code under mdx().

If someone run into the same issue, please give it a try!

Cheers!

luis-echegaray commented 5 years ago

saw the same thing and came to post about it! good looking out @davinakano !

1Marc commented 4 years ago

Added to the course errata as well as in a pop up annotation to the course... thanks @davinakano @denvercoder @luis-echegaray !

Screen Shot 2019-12-03 at 1 44 43 PM