Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geocine/gatsby-source-dev
Gatsby source plugin that fetches user articles from Dev.to
https://github.com/geocine/gatsby-source-dev
devto gatsby gatsby-plugin gatsbyjs
Last synced: 3 months ago
JSON representation
Gatsby source plugin that fetches user articles from Dev.to
- Host: GitHub
- URL: https://github.com/geocine/gatsby-source-dev
- Owner: geocine
- License: mit
- Created: 2019-03-26T13:52:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T18:36:17.000Z (almost 2 years ago)
- Last Synced: 2024-09-26T00:28:19.745Z (3 months ago)
- Topics: devto, gatsby, gatsby-plugin, gatsbyjs
- Language: JavaScript
- Homepage:
- Size: 1.12 MB
- Stars: 26
- Watchers: 4
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gatsby-source-dev
[![NPM version](https://badgen.net/npm/v/gatsby-source-dev)](https://www.npmjs.com/package/gatsby-source-dev) [![Build Status](https://travis-ci.org/geocine/gatsby-source-dev.svg?branch=master)](https://travis-ci.org/geocine/gatsby-source-dev)
A Gatsby plugin that fetches user articles from Dev.to’s `/articles?username` combined with `/articles/${id}` endpoint.
## Usage
Install `gatsby-source-dev` in your project:
```
yarn add gatsby-source-dev
npm install gatsby-source-dev
```Then add the plugin to your `gatsby-config.js` file:
```js
{
resolve: "gatsby-source-dev",
options: {
// This is your username on Dev.to
username: ''
}
}
```The plugin will store the Dev.to API response in Gatsby. Here's an example of a query that fetches an articles `title`, `id`, and `description`.
```js
{
allDevArticles {
edges {
node {
article {
id
title
description
}
}
}
}
}
```The node contains the entire response from Dev.to’s endpoint.
> Pagination is not yet implemented