Class: GraphQL::Rails::SchemaController

Inherits:
ActionController::Base
  • Object
show all
Includes:
ControllerExtensions
Defined in:
app/controllers/graphql/rails/schema_controller.rb

Instance Method Summary collapse

Methods included from ControllerExtensions

#add, #included

Instance Method Details

#executeObject

Execute a GraphQL query against the current schema.



15
16
17
18
19
20
21
# File 'app/controllers/graphql/rails/schema_controller.rb', line 15

def execute
  render json: Schema.instance.execute(
    params[:query],
    variables: to_hash(params[:variables]),
    context: context
  )
end