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:
commit
5d61444852
2 changed files with 4 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -24,8 +24,7 @@ function GraphiQLWithExplorer() {
|
|||
plugins: [explorer],
|
||||
query: query,
|
||||
variables: defaultVariables,
|
||||
onEditQuery: setQuery,
|
||||
isHeadersEditorEnabled: false
|
||||
onEditQuery: setQuery
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue