Merge pull request #10369 from mfo/US/playground-for-everyone

ETQ developpeur, je souhaite pouvoir utiliser le playground même si je ne suis pas administrateur
This commit is contained in:
mfo 2024-04-23 09:27:55 +00:00 committed by GitHub
commit 5d61444852
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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
});
}