feat(api.playground): playground is accessible to anyone. allow user to fill in headers

This commit is contained in:
mfo 2024-04-23 09:53:32 +02:00
parent cd0c891c16
commit 62a2aee923
2 changed files with 4 additions and 8 deletions

View file

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

View file

@ -24,8 +24,7 @@ function GraphiQLWithExplorer() {
plugins: [explorer],
query: query,
variables: defaultVariables,
onEditQuery: setQuery,
isHeadersEditorEnabled: false
onEditQuery: setQuery
});
}