Put graphql behind a feature flag
This commit is contained in:
parent
eb7aba18e6
commit
5a7e415474
3 changed files with 3 additions and 2 deletions
|
@ -16,7 +16,7 @@ module Types
|
|||
end
|
||||
end
|
||||
|
||||
if administrateur
|
||||
if administrateur && Flipper.enabled?(:administrateur_graphql, administrateur.user)
|
||||
context[:authorized][demarche.id] = true
|
||||
true
|
||||
end
|
||||
|
|
|
@ -26,6 +26,7 @@ end
|
|||
# A list of features to be deployed on first push
|
||||
features = [
|
||||
:administrateur_champ_integer_number,
|
||||
:administrateur_graphql,
|
||||
:administrateur_web_hook,
|
||||
:insee_api_v3,
|
||||
:instructeur_bypass_email_login_token,
|
||||
|
|
|
@ -219,7 +219,7 @@ Rails.application.routes.draw do
|
|||
# API
|
||||
#
|
||||
|
||||
authenticated :user, lambda { |user| user.administrateur_id } do
|
||||
authenticated :user, lambda { |user| user.administrateur_id && Flipper.enabled?(:administrateur_graphql, user) } do
|
||||
mount GraphiQL::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql", via: :get
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue