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 surenode
andnode.projectchildpages.length > 0
aretrue
projectchildpages
is an array so noprojectchildpages.slug
here
query
your fetched data (source) doesn't contain _rawblockcontent
so you can't query for this in page component.
Source: stackoverflow.com
Related Query
- Gatsby node fails to generate page
- Getting an "Exported queries are only executed for Page components." in Gatsby when trying to generate pages
- Gatsby not generate correct page
- Gatsby slug does not generate correct page
- add raw HTML with <script> inside Gatsby React page
- How do I go to previous page in gatsby (history.goBack)
- Gatsby error when creating a new route: Preparing requested page
- In Webpack 4, can we dynamically generate page chunk with import() token so we can turn a react component into a react-loadable one?
- How to unpublish a gatsby page without deleting it?
- GraphQL query works in Gatsby page but not inside class component
- Using Require with React in a web page without node
- Gatsby page in page
- Gatsby losing/disappearing CSS on page refresh?
- Only load Snipcart on specific page in Gatsby
- proxy socket io fails to connect with nginx, node on docker
- Disappearing HTML on first visit to the page with Gatsby and Material UI in production only
- How to load script in specific page in gatsby
- Consuming useContext in a Gatsby page
- Gatsby Link pass previous page's location.path to next page via Props
- Gatsby - page refresh corruption
- Gatsby hybrid app - Issues with sub routing on a page which is built using a template in `createPage`
- Exact same code from dangerouslySetInnerHTML not working only inside Gatsby / ReactJS page
- got 404 when reload the page in dynamic route in gatsby on production only
- Gatsby Build Fails on Netlify Deploy
- Passing location and pageContext from page to child components in Gatsby
- How to create a single Gatsby Page to show and filter all blog posts by tag/category
- How to test a gatsby page containing components with multiple static queries?
- Get Array of All Existing Page Routes in Gatsby
- How to implement zendesk web widget to specific page on gatsby
- ReactJS auth not working, redirect to login page fails
More Query from same tag
- Why do we need Express server when we have a backend ready already
- How do I set multipart in axios with react?
- can't deploy heroku with mern +graphql
- React\Redux render() not being called after change in state
- More specific than ReactNode?
- Rendering a form dynamically in react
- Argument of type 'CallHistoryMethodAction<[string, unknown?]>' is not assignable to parameter of type 'UserActionType'
- Pasing fetched data as props (a JSON) to state in order to render data
- Installing react-redux in a Rails project
- npm install throwing UNMET PEER DEPENDENCY error when package.json has the correct version
- Date formatting using moment in react.js
- Tailwind custom background-image not working in production
- Do function components have props in React?
- React - Filter In Dropdown?
- Regex to validate size units like 10,10Gi,10.5Mi,10Ki?
- How to redirect on login page in Next.js
- How to get value from multiple id's in a search form to be used in a axios call
- HTTP intercept not being invoked. What could be the reason for this?
- Redux: Reducer needs state of other Reducer?
- ReactJS rendering a collection of children throws "Invariant Violation: Objects are not valid as a React child" error
- Sibling Functional Components communication in reactjs
- How do you make the ListHeaderComponent of a React Native FlatList sticky?
- How to avoid jsx styling error in react native?
- Headless UI "leave" transition not working in React
- React-router scroll to top when back button is clicked
- component syntax in React
- How to remove the edges of the textfield of material ui
- Update store based on user input data in React-Redux
- Is there a simple CRUD example app using react.js and firebase?
- React-hook-form doesn't set isDirty to false when back to initial state