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.8.2 lib/graphql/boolean_type.rb
graphql-1.8.1 lib/graphql/boolean_type.rb
graphql-1.8.0 lib/graphql/boolean_type.rb
graphql-1.8.0.pre11 lib/graphql/boolean_type.rb
graphql-1.8.0.pre10 lib/graphql/boolean_type.rb
graphql-1.7.14 lib/graphql/boolean_type.rb
graphql-1.8.0.pre9 lib/graphql/boolean_type.rb
graphql-1.8.0.pre8 lib/graphql/boolean_type.rb
graphql-1.7.13 lib/graphql/boolean_type.rb
graphql-1.8.0.pre7 lib/graphql/boolean_type.rb
graphql-1.7.12 lib/graphql/boolean_type.rb
graphql-1.7.11 lib/graphql/boolean_type.rb
graphql-1.7.10 lib/graphql/boolean_type.rb
graphql-1.8.0.pre6 lib/graphql/boolean_type.rb
graphql-1.8.0.pre5 lib/graphql/boolean_type.rb
graphql-1.7.9 lib/graphql/boolean_type.rb
graphql-1.8.0.pre4 lib/graphql/boolean_type.rb
graphql-1.8.0.pre3 lib/graphql/boolean_type.rb
graphql-1.7.8 lib/graphql/boolean_type.rb
graphql-1.8.0.pre2 lib/graphql/boolean_type.rb