demarches-normaliennes/app/controllers/graphql_controller.rb

12 lines
362 B
Ruby

class GraphqlController < ApplicationController
def playground
procedure = current_administrateur&.procedures&.last
gon.default_variables = {
"demarcheNumber": procedure&.id || 42,
"includeDossiers": true
}.compact.to_json
gon.default_query = API::V2::StoredQuery.get('ds-query-v2')
render :playground, layout: false
end
end