You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 25, 2019. It is now read-only.
The application structure is setup like a typical Rails app using controllers, views and routes with one key difference, no models. This app doesn't connect directly to any database. All the data is being fetched remotely from the GitHub GraphQL API. Instead of declaring resource models, data queries are declared right along side their usage in controllers and views. This allows an efficient single request to be constructed rather than making numerous REST requests to render a single view.
Table of Contents
Jump right into the code and read the inline documentation. The following is a suggested reading order:
config/application.rb configures GraphQL::Client to point to the GitHub GraphQL endpoint.
Running locally
First, you'll need a GitHub API access token to make GraphQL API requests. This should be set as a GITHUB_ACCESS_TOKEN environment variable as configured in config/secrets.yml.
$ git clone https://github.com/github/github-graphql-rails-example
$ cd github-graphql-rails-example/
$ bundle install
$ GITHUB_ACCESS_TOKEN=abc123 bin/rails server