Skip to content

Commit 9b6fd30

Browse files
author
Robert Mosolgo
authored
Merge pull request #240 from josh/fix-leaked-global-const
Fix leaked global constant
2 parents 2085614 + db4e9c8 commit 9b6fd30

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/graphql/boolean_type.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
GraphQL::BOOLEAN_TYPE = GraphQL::ScalarType.define do
2-
# Everything else is nil
3-
ALLOWED_INPUTS = [true, false]
4-
52
name "Boolean"
63
description "Represents `true` or `false` values."
74

8-
coerce_input -> (value) { ALLOWED_INPUTS.include?(value) ? value : nil }
5+
coerce_input -> (value) { (value == true || value == false) ? value : nil }
96
coerce_result -> (value) { !!value }
107
end

0 commit comments

Comments
 (0)