Class: Graphql::Dashboard::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/graphql/dashboard/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#schema_classObject



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/graphql/dashboard/application_controller.rb', line 23

def schema_class
  @schema_class ||= begin
    schema_param = request.query_parameters["schema"] || params[:schema]
    case schema_param
    when Class
      schema_param
    when String
      schema_param.constantize
    else
      raise "Missing `params[:schema]`, please provide a class or string to `mount GraphQL::Dashboard, schema: ...`"
    end
  end
end