question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[gatsby-transformer-yaml] README.md differs from reality

See original GitHub issue

This 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 inside internal and does not reside alongside value

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KyleAMathewscommented, Dec 1, 2017

@DamnedScholar does your yaml file have a field named “value”?

@Charon77 you’re right! Would you like to PR a fix?

1reaction
DamnedScholarcommented, Dec 1, 2017

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 used npm install gatsby-transformer-yaml yesterday, so I know for sure that I have 1.5.12.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-transformer-yaml
Parses YAML files. Supports arrays of objects and single objects. ... Both .yaml and .yml are treated in the same way. This document...
Read more >
gatsby-source-filesystem | Yarn - Package Manager
Gatsby source plugin for building websites from local data. Markdown, JSON, images, YAML, CSV, and dozens of other data types supported.
Read more >
@ptb/gatsby-source-filesystem | Gatsby
The various “transformer” plugins transform nodes into various… ... directory for Markdown files and a "data" directory // for `.json`, `.yaml`, `.csv`.
Read more >
gatsby graphql optional field - You.com | The Search Engine You ...
I am almost able to create Hero banner images with different layouts depending on ... I have installed gatsby-source-filesystem , gatsby-transformer-remark ...
Read more >
How To Generate Pages from Markdown in Gatsby
gatsby-transformer-remark will parse your Markdown and convert your frontmatter into fields that Gatsby can query, and gatsby-source-filesystem ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found