Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yinkakun/gatsby-source-hnapi

Source plugin for pulling data into Gatsby from node-hnapi, an unofficial API for Hacker News.
https://github.com/yinkakun/gatsby-source-hnapi

gatsby gatsby-source-hnapi gatsby-source-plugin hackernews

Last synced: about 2 months ago
JSON representation

Source plugin for pulling data into Gatsby from node-hnapi, an unofficial API for Hacker News.

Awesome Lists containing this project

README

        

## gatsby-source-hnapi

Source plugin for pulling data into Gatsby from [node-hnapi](https://github.com/cheeaun), an unofficial API for Hacker News.

## Install

```sh
npm install gatsby-source-hnapi

#or

yarn add gatsby-source-hnapi
```

## How to use

```js
// In your gatsby-config.js
plugins: [`gatsby-source-hnapi`];
```

## How To Query

Returns 30 results for `allHnTopstories`, `allHnLateststories`, `allHnBeststories`, `allHnAsks`, `allHnShow`, and `allHnJobs`.

```graphql
query MyQuery {
allHnLatestStories {
nodes {
title
url
points
user
id
time_ago
time
domain
comments
}
}
}
```

## Credits

This plugin is wrapper around [node-hnapi](https://github.com/cheeaun/node-hnapi)