rmosolgo / graphiql-rails

Mount the GraphiQL query editor in a Rails app
MIT License
447 stars 135 forks source link

uninitialized constant GraphqlController::GraphQLIntroSchema Did you mean? GraphQlIntroSchema #86

Closed Souravgoswami closed 3 years ago

Souravgoswami commented 4 years ago

Hi, I am just getting started with GraphQL.

  1. I created one app, and ran:
$ bundle add graphql graphiql-rails

Which added:

gem "graphql", "~> 1.11"
gem "graphiql-rails", "~> 1.7"

to Gemfile

  1. Ran

    $ rails g graphql:install
  2. Typed this content to app/assets/config/manifest.js:

    //= link graphiql/rails/application.css
    //= link graphiql/rails/application.js
  3. Typed this content to config/routes.rb:

    Rails.application.routes.draw do
    if Rails.env.development?
        mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql'
    end
    end
  4. Ran server:

    rails s -b 0 -p 8080
  5. Browsed to /graphiql, and got this error:

image

Souravgoswami commented 3 years ago

Solution:

uninitialized constant GraphqlController::GraphQLSchema