In this lesson, you’ll use GraphQL to query for transformed Markdown blog posts and display links to each of them on the blog’s homepage.
Is anybody else getting a strange error from GrahpQl?
Invariant Violation: GraphQLCompilerContext: Duplicate document named `HomepageQuery`. GraphQL fragments and roots must have unique names.
t: Duplicate document named `HomepageQuery`. GraphQL fragments and roots must have unique names.```
Hey James, good question. It seems that StaticQuery can do most of the things that page query can, including fragments. The main differences are:
pageContext
) but can only be added to page components.As of Gatsby v2, StaticQuery
seems to be the default choice. So I would suggest just using StaticQuery. Link to the documentation.