[gatsby-transformer-yaml] README.md differs from reality
See original GitHub issueThis issue refers to gatsby-transformer-yaml README.md. I’m using gatsby-transformer-yaml 1.5.12.
Summary: I believe README.md is not accurate or does not represent the current version thus needs to be updated.
Highlights:
- allLettersYaml instead of allLetters
type
is insideinternal
and does not reside alongsidevalue
Issue 1. -Yaml ending.
The readme says: … Then the following three nodes would be created.
;[
{
value: "a",
type: "Letters",
},
{
value: "b",
type: "Letters",
},
{
value: "c",
type: "Letters",
},
]
However, after running gatsby with this directory structure:
src
\-- data
\-- letters
\-- letters.yml
I only have this node:
allLettersYaml
as opposed to
allLetters
as stated in the README. I don’t knkow where the Yaml
ending comes from.
Issue 2. - type
does not exist
The Readme says:
;[
{
value: "a",
type: "Letters",
},
{
value: "b",
type: "Letters",
},
{
value: "c",
type: "Letters",
},
]
However, running allLettersYaml through GraphQL:
allLettersYaml {
edges {
node {
value
type
}
}
}
Doesn’t work, because there is no type
field. Looking up the source code reveals that this happens because type
is inside internal
.
But, this works:
allLettersYaml {
edges {
node {
value
internal {
type
}
}
}
}
Conclusion
I believe the Readme needs updating, but it could also be that I’m wrong, maybe I use the wrong version or interpreted the Readme wrongly. If I’m right and indeed the Readme needs updating, I’d like to give PR.
Thank you.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
@DamnedScholar does your yaml file have a field named “value”?
@Charon77 you’re right! Would you like to PR a fix?
I’m having all of the same problems, except that I can’t even get
value
out of my YAML nodes (image below). The readme definitely needs to be updated to the correct information. I usednpm install gatsby-transformer-yaml
yesterday, so I know for sure that I have1.5.12
.