Sha256: 771c1f5c33226879bc941eb82c817e12c2a925663542c3666b19b20e43a85101

Contents?: true

Size: 274 Bytes

Versions: 1

Compression:

Stored size: 274 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 }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graphql-1.3.0 lib/graphql/boolean_type.rb