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
|
||||||
end
|
end
|
||||||
|
|
||||||
if administrateur
|
if administrateur && Flipper.enabled?(:administrateur_graphql, administrateur.user)
|
||||||
context[:authorized][demarche.id] = true
|
context[:authorized][demarche.id] = true
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,6 +26,7 @@ end
|
||||||
# A list of features to be deployed on first push
|
# A list of features to be deployed on first push
|
||||||
features = [
|
features = [
|
||||||
:administrateur_champ_integer_number,
|
:administrateur_champ_integer_number,
|
||||||
|
:administrateur_graphql,
|
||||||
:administrateur_web_hook,
|
:administrateur_web_hook,
|
||||||
:insee_api_v3,
|
:insee_api_v3,
|
||||||
:instructeur_bypass_email_login_token,
|
:instructeur_bypass_email_login_token,
|
||||||
|
|
|
@ -219,7 +219,7 @@ Rails.application.routes.draw do
|
||||||
# API
|
# 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
|
mount GraphiQL::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql", via: :get
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue