feat(api.playground): playground is accessible to anyone. allow user to fill in headers
This commit is contained in:
parent
cd0c891c16
commit
62a2aee923
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