Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

gatsby-source-hacker-news

2.4.10 • Public • Published

gatsby-source-hacker-news

Source plugin for pulling data into Gatsby from the Hacker News API

Install

npm install --save gatsby-source-hacker-news

How to use

// In your gatsby-config.js
plugins: [`gatsby-source-hacker-news`]

How to query

You can query nodes created from Hacker News like the following:

query {
  allHnStory(sort: { fields: [order] }) {
    edges {
      node {
        id
        title
        score
        order
        domain
        url
        by
        descendants
        timeISO(fromNow: true)
        childrenHnComment {
          id
          text
          timeISO(fromNow: true)
          by
        }
      }
    }
  }
}

Install

npm i gatsby-source-hacker-news

DownloadsWeekly Downloads

18

Version

2.4.10

License

MIT

Unpacked Size

21.5 kB

Total Files

7

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar