Community Plugin
View plugin on GitHubgatsby-yaml-full-import 
Plugin for gatsby-transformer-yaml-full to enable import of other YAML files
or fields using !import tag.
Installation
npm install gatsby-yaml-full-import gatsby-transformer-yaml-fullUsage
/* gatsby-config.js */
module.exports = {
plugins: [
{
resolve: 'gatsby-transformer-yaml-full',
options: {
plugins: ['gatsby-yaml-full-import']
}
}
]
}Import all fields from a file
The following ./index.yaml and ./post.yaml files, respectively:
---
importedPost: !import ./post.yamltitle: Post titleWill return:
{
data: {
indexYaml: {
importedPost: {
title: 'Post title'
}
}
}
}With the following query:
query {
indexYaml {
importedPost {
title
}
}
}Import a specific field from a file
An exclamation mark (!) separates the file name from the field query. The
field query supports array indexes too.
The following ./index.yaml and ./post.yaml files, respectively:
---
importedAuthorName: !import ./post.yaml!authors.1.nameauthors:
- name: John Doe
- name: John Q.Will return:
{
data: {
indexYaml: {
importedAuthorName: 'John Q.'
}
}
}With the following query:
query {
indexYaml {
importedAuthorName
}
}