So I created a starter Gatsby site by following this:
I have some simple content on GraphCMS:
I am trying to query GraphCMS to return all the page posts. When experimenting with GraphiQL locally I use this query:
query PageQuery {
allGraphCmsPage {
nodes {
headline
tagline
}
}
}
Which returns exactly what I want
In my index.js I am querying graphCMS with this code:
const {graphCmsPage = {}} = useStaticQuery (graphql`
query PageQuery {
allGraphCmsPage {
nodes {
headline
tagline
}
}
}
`);
When I console.log it or try to reference any of the properties, they are all null/(the object being returned itself is a proto)
I am very new to GraphQL & Gatsby so I imagine I am not resolving something properly.