demarches-normaliennes/app/controllers/graphql_controller.rb
2024-08-22 09:26:48 +02:00

14 lines
393 B
Ruby

# frozen_string_literal: true
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