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

gatsby-source-github-repo

Gatsby source plugin for pulling data directly from a GitHub repository page.

It was created to retrieve information that cannot currently be accessed via the GitHub API, like the total contributor count.

Install

npm install --save gatsby-source-github-repo 

How to use

In your gatsby-config.js:

plugins: [
  {
    resolve: 'gatsby-source-github-repo',
    options: {
      repoUrl: 'https://github.com/gatsby/gatsby',
    },
  },
];

You can then query the data via graphql: localhost:8000/___graphql

{
  gitHubRepoData {
    url
    description
    website
    topics
    commitCount
    releaseCount
    branchCount
    contributorCount
    licence
    languageStats {
      lang
      percentage
    }
  }
}
Docs
Tutorials
Plugins
Blog
Showcase