graphql-relay-walker/examples/github_walker
Garen J. Torikian 281c254104
Let Rubocop do its thing
2018-03-27 18:54:35 -04:00
..
lib Let Rubocop do its thing 2018-03-27 18:54:35 -04:00
script Let Rubocop do its thing 2018-03-27 18:54:35 -04:00
Gemfile Let Rubocop do its thing 2018-03-27 18:54:35 -04:00
README.md first commit 2016-10-18 09:27:31 -06:00

README.md

GitHub Walker

GraphQL Relay Walker example: walk GitHub's GraphQL API

Usage

You can use this code as a library:

require "github_walker"

# Walk the graph, printing each object we come across.
GitHubWalker.walk do |frame|
  msg = "Found object `#{frame.gid}`"
  msg += " via object `#{frame.parent.gid}`" += if frame.parent
  puts message
end

or you can run the provided script:

# install dependencies
bundle install

# Walk the graph.
script/walk

either way, you need to have a GitHub API token in your environment:

export GITHUB_ACCESS_TOKEN=<my access token>

You can make one of these tokens here. Your token will need these scopes:

  • read:gpg_key
  • read:org
  • read:public_key
  • read:repo_hook
  • repo
  • user