Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-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:

alt text

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
      }
    }
  }
}
© 2023 Gatsby, Inc.