score:1

Accepted answer

code

result.data.allsanityprojects.edges.foreach(({ node }) => {
    node.projectchildpages.map(childpage => {
      if (node && node.projectchildpages.length > 0 && node.projectchildpages.slug) {

condition doesn't have much sense there:

  • if you're in .map() then for sure node and node.projectchildpages.length > 0 are true
  • projectchildpages is an array so no projectchildpages.slug here

query

your fetched data (source) doesn't contain _rawblockcontent so you can't query for this in page component.


Related Query

More Query from same tag