All Projects → DSchau → Gatsby Source Github

DSchau / Gatsby Source Github

A source plugin for Gatsby to source Github data from its GraphQL API for static builds

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gatsby Source Github

Felipefialho.com
😺 My personal website
Stars: ✭ 177 (+1080%)
Mutual labels:  graphql, gatsby
Amdec Website
Stars: ✭ 219 (+1360%)
Mutual labels:  graphql, gatsby
Smakosh.com
My personal website
Stars: ✭ 185 (+1133.33%)
Mutual labels:  graphql, gatsby
Gatsby Wpgraphql Blog Example
Demo showing how to use WPGraphQL as the source for Gatsby Sites
Stars: ✭ 152 (+913.33%)
Mutual labels:  graphql, gatsby
Mvfsillva
My personal website
Stars: ✭ 13 (-13.33%)
Mutual labels:  graphql, gatsby
Gatsby Plugin Algolia
A plugin to push to Algolia based on graphQl queries
Stars: ✭ 154 (+926.67%)
Mutual labels:  graphql, gatsby
Website
Website of [email protected], Powered by JAMStack
Stars: ✭ 218 (+1353.33%)
Mutual labels:  graphql, gatsby
Gatsby Starter Lumen
A constantly evolving and thoughtful architecture for creating static blogs.
Stars: ✭ 1,797 (+11880%)
Mutual labels:  graphql, gatsby
Graphcms Examples
Example projects to help you get started with GraphCMS
Stars: ✭ 295 (+1866.67%)
Mutual labels:  graphql, gatsby
Wp Graphql
🚀 GraphQL API for WordPress
Stars: ✭ 3,097 (+20546.67%)
Mutual labels:  graphql, gatsby
Gatsby Source Prismic Graphql
Gatsby source plugin for Prismic GraphQL
Stars: ✭ 144 (+860%)
Mutual labels:  graphql, gatsby
Gatsby Starter Personal Blog
A ready to use, easy to customize, fully equipped GatsbyJS blog starter with 'like app' layout and views transitions.
Stars: ✭ 817 (+5346.67%)
Mutual labels:  graphql, gatsby
Gatsby Starter Foundation
A starter to launch your blazing fast personal website and a blog, Built with Gatsby and Netlify CMS. Made with ❤ by Stackrole
Stars: ✭ 135 (+800%)
Mutual labels:  graphql, gatsby
Jamstack Serverless
Learn JAMstack Serverless Modern App Development in Baby Steps using Gatsby.js, React, TypeScript, GraphQL, Contentful, Netlify, FaunaDB, MongoDB, Apollo, Github Actions, Project Fugu, and CSS Houdini.
Stars: ✭ 178 (+1086.67%)
Mutual labels:  graphql, gatsby
Gatsby Blog Starter Kit
A simple starter kit for a static blog created with Gatsby
Stars: ✭ 131 (+773.33%)
Mutual labels:  graphql, gatsby
Gatsby Starter Morning Dew
🚀 A Gatsby theme/starter to build lightning-fast blog/websites
Stars: ✭ 186 (+1140%)
Mutual labels:  graphql, gatsby
Gatsby Typescript
Alternative typescript support plugin for Gatsbyjs. Aims to make using typescript in Gatsby as painless as possible
Stars: ✭ 95 (+533.33%)
Mutual labels:  graphql, gatsby
Gatsbytutorials.com
A community-updated list of video, audio and written tutorials to help you learn GatsbyJS. 👩‍💻
Stars: ✭ 109 (+626.67%)
Mutual labels:  graphql, gatsby
Gatsby
Build blazing fast, modern apps and websites with React
Stars: ✭ 51,925 (+346066.67%)
Mutual labels:  graphql, gatsby
Gatsby Woocommerce Themes
⚡ A Gatsby Theme for WooCommerce E-commerce site Gatsby WooCommerce WordPress
Stars: ✭ 306 (+1940%)
Mutual labels:  graphql, gatsby

gatsby-source-github (DEPRECATED)

Build Status


Use gatsby-source-graphql to enable schema stitching with Github's API, rather than this source plugin.


Source plugin for pulling in Github data (using its GraphQL API) at buildtime for static generation and further GraphQL querying with Gatsby. Check out this repo for an example usage.

Install

npm install gatsby-source-github --save-dev

How to use

In your gatsby-config.js:

plugins: [
  {
    resolve: 'gatsby-source-github',
    options: {
      headers: {
        Authorization: `Bearer YOUR_GITHUB_PERSONAL_ACCESS_TOKEN`, // https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
      },
      queries: [
        `{
          repository(owner: "nebraskajs", name: "speaker-signup") {
            issues(last: 20, states: OPEN) {
              edges {
                node {
                  id
                  author {
                    avatarUrl
                    login
                    url
                  }
                  bodyHTML
                  title
                  url
                }
              }
            }
          }
        }`,
      ],
    },
  },
];

queries is an array of GraphQL queries. The algorithm to generate Gatsby GraphQL nodes is described below

How to query

In general, use the Github API v4 documentation and in particular, the explorer to craft your queries and refer to the the below algorithm for how to query against these results with Gatsby.

Using variables

Additionally, variables can be used/injected into the queries. Rather than sending a string in the queries array, send an array like so:

[
  `query getViewer($first: Int!) {
    viewer {
      login
      name
      repositories(first:$first) {
        edges {
          node {
            name
          }
        }
      }
    }
  }`,
  { first: 10 },
];

The algorithm

The algorithm is quite simple. It'll descend through the tree/returned structure, and if it finds an edges key will use the parent of that as the node name. For instance, in the above repository example, githubIssue will be the node name, and allGithubIssues will be the way to query against all nodes. In the viewer example the node name will be githubViewer.

All fields in the node that are queried against in the Github GraphQL query are available to be queried with Gatsby. For example, in the repository example above, id, author (and subfields), bodyHTML, etc. are available to be queried against.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].