Ruby Graphiql Explorer
Super simple rack app to render GraphiQL editor into a Ruby or Rails web app.
Installation
Add this line to your application's Gemfile:
gem "ruby_graphiql_explorer"And then execute:
$ bundle install
Or install it yourself as:
$ gem install ruby_graphiql_explorer
Usage
Rails
Mount the rack app in routes.rb
mount RubyGraphiqlExplorer::App, at: "/graphiql"Ruby
Using config.ru
require "ruby_graphiql_explorer"
run RubyGraphiqlExplorer::AppUsing Rack::URLMap
require "ruby_graphiql_explorer"
run Rack::URLMap.new("/graphiql" => RubyGraphiqlExplorer::App)By default the rack app expects GraphQL endpoint to be available at
http://localhost::3000/graphql but you can override using
GRAPHQL_API_URL env variable. Additionally, you can set api key/token using
GRAPHQL_API_KEY if your GraphQL API is protected.
GRAPHQL_API_URL: http://localhost::3000/api
GRAPHQL_API_KEY: foobarDevelopment
After checking out the repo, run bundle to install dependencies. Then, run bundle exec rspec spec to run the tests.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/gauravtiwari/ruby_graphiql_explorer.
