Sha256: 21a994621c701f73170ab1a908b69808fed5325a87b2d560d6a2971665975d60

Contents?: true

Size: 308 Bytes

Versions: 49

Compression:

Stored size: 308 Bytes

Contents

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

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

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
graphql-1.5.13 lib/graphql/boolean_type.rb
graphql-1.5.7.1 lib/graphql/boolean_type.rb
graphql-1.5.12 lib/graphql/boolean_type.rb
graphql-1.5.11 lib/graphql/boolean_type.rb
graphql-1.5.10 lib/graphql/boolean_type.rb
graphql-1.5.9 lib/graphql/boolean_type.rb
graphql-1.5.8 lib/graphql/boolean_type.rb
graphql-1.5.7 lib/graphql/boolean_type.rb
graphql-1.5.6 lib/graphql/boolean_type.rb