This post was originally published at codebushi.com
For a video tutorial, check out https://www.youtube.com/watch?v=kOrohVsq_kI
Gatsby.js V2 was...
For further actions, you may consider blocking this person and/or reporting abuse
Excellent tutorial Hunter! Quick question, if you don't mind. Why does the
pageQuery
const need to be exported? Is this simply howGatsby-image
accesses the query? Thanks!Yes, that's how the component is able to consume the GraphQL query. I think it needs to be exported because that's how Gatsby is able to process it during the build. Check out this page for more info: gatsbyjs.org/docs/page-query
Hallo, thank you so much for this helpful guide! The DRY code at the end was a gem. If you don't mind asking me though, would you happen to know how to test a component that uses gatsby-image?
This is a good learning curve to get going with graphql and gatsby-image. Nicely structured.