Skip to main content
View plugin on GitHub
See starters using this

gatsby-source-qiita

npm version

Source plugin for pulling data into Gatsby from Qiita using the Qiita API v2.

Install

npm install --save gatsby-source-qiita

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-qiita`,
      options: {
        accessToken: `YOUR_PERSONAL_ACCESS_TOKEN`,
        userName: `YOUR_UAWE_NAME`,
        // (optional)
        // Default is false.
        fetchPrivate: false,
        // (optional)
        // String Array.
        // Default is [].
        excludedPostIds: ['da8347f81a9f021b637f']
      }
    }
  ]
}

How to query

{
  allQiitaPost {
    edges {
      node {
        id
        title
        headings {
          value
          id
          depth
          parents {
            value
            id
            depth
          }
        }
        rendered_body
        body
        comments_count
        created_at
        likes_count
        reactions_count
        tags {
          name
        }
        updated_at
        url
        user {
          id
        }
      }
    }
  }
}

Sample