Sha256: 5a7bbd94d3a677f1880315bea8e617e54a843661fc058b1e1f26e027cda43225

Contents?: true

Size: 244 Bytes

Versions: 10

Compression:

Stored size: 244 Bytes

Contents

GraphQL::BOOLEAN_TYPE = GraphQL::ScalarType.define do
  name "Boolean"
  description "Represents `true` or `false` values."

  coerce_input ->(value) { (value == true || value == false) ? value : nil }
  coerce_result ->(value) { !!value }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
graphql-1.2.6 lib/graphql/boolean_type.rb
graphql-1.2.5 lib/graphql/boolean_type.rb
graphql-1.2.4 lib/graphql/boolean_type.rb
graphql-1.2.3 lib/graphql/boolean_type.rb
graphql-1.2.2 lib/graphql/boolean_type.rb
graphql-1.2.1 lib/graphql/boolean_type.rb
graphql-1.2.0 lib/graphql/boolean_type.rb
graphql-1.1.0 lib/graphql/boolean_type.rb
graphql-1.0.0 lib/graphql/boolean_type.rb
graphql-0.19.4 lib/graphql/boolean_type.rb