Class: Graphql::Dashboard::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Graphql::Dashboard::ApplicationController
- Defined in:
- lib/graphql/dashboard/application_controller.rb
Direct Known Subclasses
DetailedTraces::TracesController, LandingsController, Limiters::LimitersController, OperationStore::BaseController, StaticsController, Subscriptions::BaseController
Instance Method Summary collapse
Instance Method Details
#schema_class ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/graphql/dashboard/application_controller.rb', line 23 def schema_class @schema_class ||= begin configured_schemas = Array(request.path_parameters[:schema] || request.path_parameters["schema"]) schema_param = request.query_parameters["schema"] schema_param = configured_schemas.find { |schema| schema.to_s == schema_param } if schema_param schema_param ||= configured_schemas.first 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 |