Gatsby source plugin for building websites using Hacker News as a data source
npm install gatsby-source-hacker-newsSource plugin for pulling data into Gatsby from the
Hacker News API
npm install gatsby-source-hacker-news
``javascriptgatsby-source-hacker-news
// In your gatsby-config.js
plugins: []`
You can query nodes created from Hacker News like the following:
`graphql``
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
}
}
}
}
}