Class: Decidim::Api::QueriesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::Api::QueriesController
- Defined in:
- app/controllers/decidim/api/queries_controller.rb
Overview
This controller takes queries from an HTTP endpoint and sends them out to the Schema to be executed, later returning the response as JSON.
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/decidim/api/queries_controller.rb', line 10 def create query_string = params[:query] query_variables = ensure_hash(params[:variables]) result = Schema.execute(query_string, variables: query_variables, context: context) render json: result end |