From eadceb106c98fc7caf341b4c0c910fa954a10756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Mon, 2 Jan 2017 11:27:56 +0100 Subject: [PATCH] Only mount graphiql in development environment --- Gemfile | 2 +- config/routes.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 16da51749..b9799f3d6 100644 --- a/Gemfile +++ b/Gemfile @@ -66,7 +66,6 @@ gem 'turnout', '~> 2.4.0' gem 'redcarpet' gem 'graphql' -gem 'graphiql-rails' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console @@ -104,6 +103,7 @@ end group :development do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '3.3.0' + gem 'graphiql-rails' end eval_gemfile './Gemfile_custom' diff --git a/config/routes.rb b/config/routes.rb index d8f0d4476..5a8d8c2b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -265,12 +265,12 @@ Rails.application.routes.draw do end # GraphQL - mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql' get '/graphql', to: 'graphql#query' post '/graphql', to: 'graphql#query' if Rails.env.development? mount LetterOpenerWeb::Engine, at: "/letter_opener" + mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql' end mount Tolk::Engine => '/translate', :as => 'tolk'