Skip to content

Commit db4e9c8

Browse files
committed
Remove ALLOWED_INPUTS const
Constant inside of block leaks into Object scope.
1 parent 03fd1fc commit db4e9c8

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)