The documentation here https://www.gatsbyjs.org/docs/gatsby-config/#mapping-node-types fails to mention you need to install the Yaml plugin.
Hey @idahogurl! Thanks for opening issue.
I'm not sure what's the best approach here, because that part of documentation is using Markdown, Yaml and Json as examples, but mapping is not limited to those and those are just used to illustrate mapping feature.
To me, adding installation instruction for those plugins would divert attention from the essence of content there.
Perhaps a short comment that they require the respective plugin to be installed.
Hi @pieh @idahogurl I encountered this issue too when I tried to add mapping to my site. I also learned that the file needs to be in the directory picked up by the gatsby-source-filesystem as well. Since I'm pretty new to Gatsby this was a #TIL for me.
What do you think of the following:
You can map between the author field in frontmatter to the id in the author.yaml objects by adding to your gatsby-config.js:
module.exports = {
plugins: [...],
mapping: {
"MarkdownRemark.frontmatter.author": `AuthorYaml`,
},
}
+ You may need to install the appropriate file transformer and source plugins for Gatsby to pick up the mapping files. This applies to other file types later mentioned in this segment as well.
Gatsby then uses this mapping when creating the GraphQL schema to enable you to query data from both sources:
Hi @pieh this has happened again. See #13660.
I helped the user with a PR to their repo and worked them through the steps for the mapping to work, but I think we at least add a note to remind the read to add the plugin with a link to the gatsby-transformer-yaml. I think it would help new users.
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 馃挭馃挏
I'm happy to open a PR and add the comment from @wgao19 if folks have decided that will help.
Oh just seeing the added label. I am also happy PR. It鈥檒l be my first contribution to this repo 馃榿 Although, I don鈥檛 have too much more insight beyond that line so if you got more to add on I think it鈥檒l be nicer for you to do it @k-conway
I was pretty much going to update with your comment so feel free to take it since you already did the hard part :-)
Thank you @k-conway! Just opened #15197, let's hear what people will say about it :)
This should be resolved with #15197 (thanks @wgao19!). Please let us know if it could be improved further!
Most helpful comment
Thank you @k-conway! Just opened #15197, let's hear what people will say about it :)