I’m a grapql newby and struggling to get the parent props from current page.
In gatsby-node.js I create all wordpress pages with:
createPage({
path: `${page.node.uri}`,
component: PageTemplate,
context: {
id: page.node.id,
title: page.node.title,
parentId: page.node.parentId
},
})
Then on the page I use following to get data from current page with:
query($id: String!) {
wpPage(id: {eq: $id}) {
id
title
uri
content
parentId
}
}
What I need is getting the parent props IF the page has a parentId, any suggestions?
Thanks in advance!