Accessing mdx body
property in onCreateNode
#31630
-
Howdy! I'm using a custom node type called However, I've hit a bit of a road block as I've realised that the I had the same issue with trying to get Playing around a little more and it seems like I can use: createNodeField({ node, name: "doc__NODE", value: otherNode.id }) on the Mdx node, then I can query Mdx nodes and navigate via the This seems like a bit of a hack as I didn't find any docs on this, and I'm not sure if I should be doing this. Additionally, I wanted to provide the ability to directly query Does anyone have any ideas about this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Finally found something! https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#foreign-key-fields I'm already using the |
Beta Was this translation helpful? Give feedback.
Finally found something! https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#foreign-key-fields
I'm already using the
@link
directive in my custom type's schema, but just for defining my own type's shape. I think this might be a way for me to create the fk relationship with an Mdx node; I'll have to play a little more...