This is a minimal reproduction of an issue that I'm seeing with Gatsby's graphql API.
To reproduce the problem:
- Clone this repository.
- Run
yarn installto install dependencies. - Run
yarn startto start the server. - When the server comes up, open
http://localhost:8000/___graphqlin a web browser. - In GraphIQL, run this query:
query MyQuery { markdownRemark(frontmatter: {path: {eq: "/mypage.html"}}) { frontmatter { path title } } topicInternalHeadings(path: {eq: "/mypage.html"}) { headings { level path text } } }
- Note that the query returns data for the
topicInternalHeadingsnode. - Go to
http://localhost:8000/myPage.html. - In the console, note that the data returned from the page query includes no data for the
topicInternalHeadingsnode:{markdownRemark: {…}, topicInternalHeadings: null}
Expected result: Node data appears in the log and on the page because the data is visible in graphiql.
The code in plugins/gatsby-remark-internal-toc/index.js creates the topicInternalHeadings nodes.