DEV Community

Discussion on: An Introduction To Using Gatsby Image & Gatsby.js V2

Collapse
 
jpm1118 profile image
Jack McCormick

Excellent tutorial Hunter! Quick question, if you don't mind. Why does the pageQuery const need to be exported? Is this simply how Gatsby-image accesses the query? Thanks!

Collapse
 
changoman profile image
Hunter Chang

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