Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Gatsby starter that sources data from the GitHub GraphQL API v4 using gatsby-source-graphql to build a portfolio site.
Gatsby Starter Github API is a Gatsby boilerplate template that sources data from the GitHub GraphQL API v4 through the gatsby-source-graphql plugin, producing a statically generated portfolio site. The starter takes a GitHub personal access token as configuration and outputs a site showing the authenticated user's profile and repositories, with a live demo hosted at https://gatsby-starter-github-api.netlify.com/.
Gatsby Starter Github API is an open-source starter project by lundgren2 that demonstrates how to query GitHub's GraphQL API v4 (not REST) and pull that data into the Gatsby data layer. It uses the gatsby-source-graphql plugin to fetch viewer information and repositories, then renders them on a default Gatsby page at src/pages/index.js. The project includes a configuration file at config/site.js where you can adjust site-level settings, and an example environment file (.env.example) that you rename to .env and fill with your GITHUB_API_TOKEN. The resulting site is a static site that can be deployed anywhere Gatsby runs, including Netlify via the built-in deploy button.
To get started, you create a new Gatsby site from this starter, generate a GitHub personal access token, copy .env.example to .env and paste the token in, then run gatsby develop. The starter reads your token, runs the GraphQL query against GitHub's API at build time, and generates a static site. After customizing the config file and source code, you can deploy it to Netlify with one click.