graphql-preview 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fc8eeb565f36949ee6ce15c4609e1c2ee5efd65
4
- data.tar.gz: da5d69a6fe681251fab40176c5f6073f18ec3954
3
+ metadata.gz: 0bfb2399d07ff4e3ded7c45dac19786986d9cb38
4
+ data.tar.gz: 1e2a9b1698c48419ffc06bb17b7160a9553ba3de
5
5
  SHA512:
6
- metadata.gz: 3fb8a0333e507048dfddb56e6a4b3c7798f5ea762a02975f7882c4546e0445e70fc6b753cf0875b16af08c63cadeb640c68164c3f5168724c1d548eeff9375ca
7
- data.tar.gz: f84fdaa16c52c932d4731b5e57a55a0e6a57995d19c1edf3c186b07560174b8ef1b0c06cd731c17b88449701dce8ba49318b5dd9b0e9db403114bd9413f30bfb
6
+ metadata.gz: f178d2fc5affbfbb0ab673d981b2302b937f082a38367db340275ec287ad1c86228bb95ac1c98a26c396be63ebd894978994a062481f38afad9a10af2bbfd44e
7
+ data.tar.gz: '00921fc90242e8481869a909f72c80ddcd47447baedc25d75c0e87ea566343a525260cf102ffd7676e2006afd5663f569e202ea85317a87b2d9ca043892e3a87'
@@ -1,11 +1,9 @@
1
1
  module GraphQLPreview
2
2
  module Extensions
3
3
  module EnabledPreviews
4
- def enabled_previews
5
- @enabled_previews
6
- end
4
+ def enabled_previews(previews = nil)
5
+ return @enabled_previews if previews.nil?
7
6
 
8
- def enabled_previews=(previews)
9
7
  unless previews.is_a?(Array)
10
8
  raise ArgumentError, "Expected `enabled_previews` to be an array, but it was `#{previews.class}`"
11
9
  end
@@ -18,6 +16,10 @@ module GraphQLPreview
18
16
 
19
17
  @enabled_previews = previews
20
18
  end
19
+
20
+ def enabled_previews=(previews)
21
+ enabled_previews(previews)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,11 +1,11 @@
1
1
  module GraphQLPreview
2
2
  class Mask
3
3
  def self.call(member, context)
4
+ return false if Library::Schema.enabled_previews.nil?
5
+ return false unless member.metadata.key?(:preview_toggled_by)
4
6
  unless context.key?(:schema_previews)
5
7
  raise ArgumentError, "You are using the `GraphQLPreview::Mask`, but key `:schema_previews` was not provided to the `context`"
6
8
  end
7
- return false if Library::Schema.enabled_previews.nil?
8
- return false unless member.metadata.key?(:preview_toggled_by)
9
9
 
10
10
  !context[:schema_previews].include?(member.metadata[:preview_toggled_by].toggled_by)
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module GraphQLPreview
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-12-06 00:00:00.000000000 Z
12
+ date: 2017-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql