Community Plugin
View plugin on GitHubgatsby-source-github-pinned
Source plugin for pulling pinned repositories into Gatsby from the GitHub GraphQL API.
Install
npm install --save gatsby-source-github-pinned
How to use
Create API Token
You first need to go here and generate a read-only api token for your repositories:
Make sure to ONLY check the puclic_repo option.
Setup Gatsby
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-github-pinned`,
options: {
apiToken: `YOUR_READONLY_API_TOKEN`
}
}
];
How to query
Get the name and url of all pinned repos:
query PinnedRepos {
allPinnedRepo {
edges {
node {
name
url
}
}
}
}