gatsby-source-github-contributors
A Gatsby source plugin for pulling all the contributors for a github repository.
Install
via npm
npm install --save gatsby-source-github-contributors
or via yarn
yarn add gatsby-source-github-contributors
Example
Getting data from two different tables:
// In gatsby-config.jsplugins: resolve: `gatsby-source-github-contributors` options: repo: "strawberry-graphql/strawberry" ;
Get all the contributors via GraphQL
{
allGitHubContributor {
nodes {
login
name
url
}
}
}
API Keys
This source doesn't require API keys but, since GitHub throttles requests, it is recommended to use a token or app credentials.
Using a token
// In gatsby-config.jsplugins: resolve: `gatsby-source-github-contributors` options: repo: "strawberry-graphql/strawberry" token: processenvGITHUB_TOKEN ;
For more authentication options, refer to github-base docs.