Sha256: fb00e5fa2599f3ce68730ab18c42121553cdc23c86e68c4af4ea721902ad02da

Contents?: true

Size: 425 Bytes

Versions: 3

Compression:

Stored size: 425 Bytes

Contents

module GraphitiGql
  class ExecutionController < GraphitiGql.config.application_controller
    def execute
      params = request.params # avoid strong_parameters
      variables = params[:variables] || {}
      result = GraphitiGql.run params[:query],
        params[:variables],
        graphql_context
      render json: result
    end

    private

    def default_context
      defined?(:current_user)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphiti_gql-0.2.19 app/controllers/graphiti_gql/execution_controller.rb
graphiti_gql-0.2.18 app/controllers/graphiti_gql/execution_controller.rb
graphiti_gql-0.2.17 app/controllers/graphiti_gql/execution_controller.rb