Closed aaronamm closed 2 years ago
Could you open a PR for it?
We can add a new option for this.
@jpedroschmitz Thanks for your reply. I will create a PR to add a new option for @rocketseat/gatsby-theme-docs
.
@jpedroschmitz PR's opened #124 Thanks.
What would you like to be added:
Parameterize typeName of gatsby-transformer-yaml plugin or make it flexible that we can expose new YAML to new GraphQL node.
Why is this needed:
Since we set typeName to static value
SidebarItems
, we cannot expose new YAML file to a new GraphQL node.Is your enhancement request related to a problem? Please describe.
I would like to add new data stored in YAML and expose it as GraphQL node that I can query later. However, adding
gatsby-transformer-yaml
plugin section in my custom gatsby-config doesn't help. This is because it cannot override the existingtypeName: 'SidebarItems'
and all new YML files will be merged to this type. This also causes an issue when trying to [query allSidebarItems in gast-by-node.js].(https://github.com/jpedroschmitz/rocketdocs/blob/main/%40rocketseat/gatsby-theme-docs-core/gatsby-node.js#L75)Additional context
This screenshot took from my personal project that I added multiple YAML files and exposed them to GraphQL nodes. I only use default type name of gatsby-transformer-yaml