Sha256: 0ef9c23c050585f9a4516a80a87fc94ad413e50c6e4fcfded8f9306aaa01ec55

Contents?: true

Size: 296 Bytes

Versions: 9

Compression:

Stored size: 296 Bytes

Contents

# frozen_string_literal: true
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 }
  default_scalar true
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql-1.5.5 lib/graphql/boolean_type.rb
graphql-1.5.4 lib/graphql/boolean_type.rb
graphql-1.5.3 lib/graphql/boolean_type.rb
graphql-1.4.5 lib/graphql/boolean_type.rb
graphql-1.4.4 lib/graphql/boolean_type.rb
graphql-1.4.3 lib/graphql/boolean_type.rb
graphql-1.4.2 lib/graphql/boolean_type.rb
graphql-1.4.1 lib/graphql/boolean_type.rb
graphql-1.4.0 lib/graphql/boolean_type.rb