We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2085614 + db4e9c8 commit 9b6fd30Copy full SHA for 9b6fd30
lib/graphql/boolean_type.rb
@@ -1,10 +1,7 @@
1
GraphQL::BOOLEAN_TYPE = GraphQL::ScalarType.define do
2
- # Everything else is nil
3
- ALLOWED_INPUTS = [true, false]
4
-
5
name "Boolean"
6
description "Represents `true` or `false` values."
7
8
- coerce_input -> (value) { ALLOWED_INPUTS.include?(value) ? value : nil }
+ coerce_input -> (value) { (value == true || value == false) ? value : nil }
9
coerce_result -> (value) { !!value }
10
end
0 commit comments