graphql-relay-walker/examples/github_walker
Benjamin P Toews 80c7187622
first commit
2016-10-18 09:27:31 -06:00
..
lib first commit 2016-10-18 09:27:31 -06:00
script first commit 2016-10-18 09:27:31 -06:00
Gemfile first commit 2016-10-18 09:27:31 -06: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