Skip to content
Gatsby source plugin that fetches user articles from Dev.to
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src feat(headers): add cache headers Apr 17, 2019
.babelrc chore(init): initial commit Mar 26, 2019
.browserslistrc chore(init): initial commit Mar 26, 2019
.eslintrc.js
.gitignore
.nvmrc
.prettierignore chore(init): initial commit Mar 26, 2019
.travis.yml
LICENSE
README.md
package.json v0.1.4 Jun 2, 2019
yarn.lock

README.md

gatsby-source-dev

NPM version Build Status

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:

{
  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.

{
  allDevArticles {
    edges {
      node {
        article {
          id
          title
          description
        }
      }
    }
  }
}

The node contains the entire response from Dev.to’s endpoint.

Pagination is not yet implemented

You can’t perform that action at this time.