gatsby-source-dev

0.1.4 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.4
    61
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.4
    61
  • 0.1.3
    2
  • 0.1.2
    2
  • 0.1.1
    6
  • 0.1.0
    1

Package Sidebar

Install

npm i gatsby-source-dev

Weekly Downloads

11

Version

0.1.4

License

MIT

Unpacked Size

9.5 kB

Total Files

6

Last publish

Collaborators

  • geocine