diff options
author | Phil Hughes <me@iamphill.com> | 2018-12-13 10:12:13 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-12-13 10:12:13 +0000 |
commit | 744f6ed12bf1ce543b4c903d27cfd8362e91795d (patch) | |
tree | aea590d166e5610ddb5b030f7579343adba3dccf /lib | |
parent | 2bb468d6b91e164eb8144877015961fe40b2709f (diff) | |
download | gitlab-ce-744f6ed12bf1ce543b4c903d27cfd8362e91795d.tar.gz |
Enable GraphQL API endpoint
Diffstat (limited to 'lib')
-rw-r--r-- | lib/constraints/feature_constrainer.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/graphql.rb | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/constraints/feature_constrainer.rb b/lib/constraints/feature_constrainer.rb index ca4376a9d38..5f8d97c8cdc 100644 --- a/lib/constraints/feature_constrainer.rb +++ b/lib/constraints/feature_constrainer.rb @@ -2,14 +2,14 @@ module Constraints class FeatureConstrainer - attr_reader :feature + attr_reader :feature, :thing, :default_enabled - def initialize(feature) - @feature = feature + def initialize(feature, thing, default_enabled) + @feature, @thing, @default_enabled = feature, thing, default_enabled end def matches?(_request) - Feature.enabled?(feature) + Feature.enabled?(feature, @thing, default_enabled: true) end end end diff --git a/lib/gitlab/graphql.rb b/lib/gitlab/graphql.rb index 74c04e5380e..8a59e83974f 100644 --- a/lib/gitlab/graphql.rb +++ b/lib/gitlab/graphql.rb @@ -3,5 +3,9 @@ module Gitlab module Graphql StandardGraphqlError = Class.new(StandardError) + + def self.enabled? + Feature.enabled?(:graphql, default_enabled: true) + end end end |