Skip to content
railsengines.com

Graphiql Rails

Mount the GraphiQL query editor in a Rails app

No ratings yet
Gem
graphiql-rails
Repository
rmosolgo/graphiql-rails
License
MIT
Stars
452
Added
August 22, 2026

About

Mount the GraphiQL query editor in a Rails app

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

What you get

  • query_params (boolean, default false): if true, the GraphQL query string will be persisted the page's query params
  • initial_query (string, default nil): if provided, it will be rendered in the query pane for a visitor's first visit
  • title (string, default nil): if provided, it will be rendered in the page tag
  • logo (string, default nil): if provided, it will be the text logo
  • csrf (boolean, default true): include X-CSRF-Token in GraphiQL's HTTP requests
  • header_editor_enabled (boolean, default false): if provided, the header editor will be rendered

Mounting it

ruby
# Gemfile
gem "graphiql-rails"

# config/routes.rb
mount GraphiQL::Rails::Engine, at: "/graphiql"

Details

452 stars on GitHub · MIT licensed · maintained by rmosolgo. Source: https://github.com/rmosolgo/graphiql-rails

Discussion (0)

Sign in to join the discussion.

No comments yet.