gatsby-source-qiita

1.2.4 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i gatsby-source-qiita

Weekly Downloads

608

Version

1.2.4

License

MIT

Unpacked Size

8.99 kB

Total Files

7

Last publish

Collaborators

  • takumon