Have ideas to improve npm?Join in the discussion! »

    gatsby-source-hacker-news

    3.7.1 • Public • Published

    gatsby-source-hacker-news

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

    Install

    npm install 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

    67

    Version

    3.7.1

    License

    MIT

    Unpacked Size

    27.9 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