8000 GitHub - armstrjare/graphiql-rails at v0.0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

armstrjare/graphiql-rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphiQL-Rails

Mount the GraphiQL IDE in Ruby on Rails.

image

Installation

Add to your Gemfile:

gem "graphiql-rails"

Usage

Mount the Engine

Add the engine to routes.rb:

# config/routes.rb
Rails.application.routes.draw do
  # ...
  if Rails.env.development?
    mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/your/endpoint"
  end
end
  • at: is the path where GraphiQL will be served. You can access GraphiQL by visiting that path in your app.
  • graphql_path: is the path to the GraphQL endpoint. GraphiQL will send queries to this path.

Configuration

You can override GraphiQL::Rails configs in an initializer (eg, config/initializers/graphiql.rb). The configs are:

# These are the default values:
GraphiQL::Rails.config.query_params = false # if true, the GraphQL query string will be persisted the page's query params.
GraphiQL::Rails.config.initial_query = GraphiQL::Rails::WELCOME_MESSAGE # This string is presented to a new user

About

Mount the GrapiQL query editor in a Rails app

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.4%
  • CSS 1.6%
  • Other 1.0%
0