GraphQL query error with markdown frontmatter image and parent #39261
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
While writing markdown I use thumbnail and parent in the frontmatter to render a thumbnail in lists and to describe my site taxonomy. This blog was created in 2019, and I recently tried to upgrade all dependencies from Gatsby 3 to 5.
This issue occurs in my custom "createPages" code, though it persists when running the site and testing in the iGraphQL explorer
Diagnosis
While reading
node-model.js
Iconsole.log
'd ids and noted it was a Setgatsby/packages/gatsby/src/schema/node-model.js
Line 527 in 4ba9652
Invesigating
_rootNodeMap
indeed, it is created as a setgatsby/packages/gatsby/src/schema/node-model.js
Line 979 in 4ba9652
There appears to be a type disparity between ids as a Set (
.add
) and ids as an Array (.push
)This code was added in Oct 2022 and includes the type disparity
696a7ba
Fix
Update the
findRootNodeAncestor
function to consistently treat nodeIds as a Set#39262
Reproduction Link
https://github.com/sdobz/gatsby-markdown-frontmatter-repro
Steps to Reproduce
a. Enable markdown plugin
Expected Result
I expect to see one page listed in the print
Actual Result
I see graphql errors
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: