From 9b65d4bb417fb4939289eab94487c894f0a62db6 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 23 May 2018 09:55:14 +0200 Subject: Initial setup GraphQL using graphql-ruby 1.8 - All definitions have been replaced by classes: http://graphql-ruby.org/schema/class_based_api.html - Authorization & Presentation have been refactored to work in the class based system - Loaders have been replaced by resolvers - Times are now coersed as ISO 8601 --- lib/constraints/feature_constrainer.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/constraints/feature_constrainer.rb (limited to 'lib/constraints') diff --git a/lib/constraints/feature_constrainer.rb b/lib/constraints/feature_constrainer.rb new file mode 100644 index 00000000000..05d48b0f25a --- /dev/null +++ b/lib/constraints/feature_constrainer.rb @@ -0,0 +1,13 @@ +module Constraints + class FeatureConstrainer + attr_reader :feature + + def initialize(feature) + @feature = feature + end + + def matches?(_request) + Feature.enabled?(feature) + end + end +end -- cgit v1.2.3