Class: Graphql::Dashboard::ApplicationController

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

Instance Method Summary collapse

Instance Method Details

#schema_classObject



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/graphql/dashboard.rb', line 62

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