lib/graphql-preview/mask.rb in graphql-preview-0.0.1 vs lib/graphql-preview/mask.rb in graphql-preview-0.0.2
- old
+ new
@@ -1,12 +1,12 @@
module GraphQLPreview
class Mask
def self.call(member, context)
+ return false if Library::Schema.enabled_previews.nil?
+ return false unless member.metadata.key?(:preview_toggled_by)
unless context.key?(:schema_previews)
raise ArgumentError, "You are using the `GraphQLPreview::Mask`, but key `:schema_previews` was not provided to the `context`"
end
- return false if Library::Schema.enabled_previews.nil?
- return false unless member.metadata.key?(:preview_toggled_by)
!context[:schema_previews].include?(member.metadata[:preview_toggled_by].toggled_by)
end
end
end