Sha256: 80e32eaf2a3f622c60c9024f3529d729d5ee966a0db7234f315789a8212358a1

Contents?: true

Size: 246 Bytes

Versions: 9

Compression:

Stored size: 246 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

9 entries across 9 versions & 1 rubygems

Version Path
graphql-0.19.3 lib/graphql/boolean_type.rb
graphql-0.19.2 lib/graphql/boolean_type.rb
graphql-0.19.1 lib/graphql/boolean_type.rb
graphql-0.19.0 lib/graphql/boolean_type.rb
graphql-0.18.15 lib/graphql/boolean_type.rb
graphql-0.18.14 lib/graphql/boolean_type.rb
graphql-0.18.13 lib/graphql/boolean_type.rb
graphql-0.18.12 lib/graphql/boolean_type.rb
graphql-0.18.11 lib/graphql/boolean_type.rb