LoginSignup
0
0

More than 3 years have passed since last update.

ActionController::RoutingError - uninitialized constant GraphiQL::Rails::EditorsController エラーの解決方法

Last updated at Posted at 2021-05-01

困ったこと

Rails 6 環境でGraphQLを実装するためこちらのサイトを参考に各種セットアップをしていたところでした。

rails generate graphql:install コマンドを実行後、 http://localhost:3000/graphiql を開いたところ、以下エラーが発生した... :sob:

ActionController::RoutingError at /
uninitialized constant GraphiQL::Rails::EditorsController

image.png

前提

  • 以下の Gem を利用している環境とする
    • rails (6.1.3.1)
    • graphql (1.12.8)
    • graphiql-rails (1.7.0)

解決方法

答えは Gem 本家のIssueに投稿されていたコメントでした。以下を追記後、Railsサーバーを再起動したら GraphiQLの画面が表示できました :tada:

config/initializers/zeitwerk.rb
Rails.autoloaders.each do |autoloader|
  autoloader.inflector = Zeitwerk::Inflector.new
+  autoloader.inflector.inflect(
+    'graphiql' => 'GraphiQL'
+  )
end

関連

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0