Sha256: 8e88f63708bbf358251d9fe80abe1653f8eeb6736157fb621622fd61bd732d35

Contents?: true

Size: 251 Bytes

Versions: 12

Compression:

Stored size: 251 Bytes

Contents

GraphQL::BOOLEAN_TYPE = GraphQL::ScalarType.define do
  # Everything else is nil
  ALLOWED_INPUTS = [true, false]

  name "Boolean"

  coerce_input -> (value) { ALLOWED_INPUTS.include?(value) ? value : nil }
  coerce_result -> (value) { !!value }
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
graphql-0.16.1 lib/graphql/boolean_type.rb
graphql-0.16.0 lib/graphql/boolean_type.rb
graphql-0.15.3 lib/graphql/boolean_type.rb
graphql-0.15.2 lib/graphql/boolean_type.rb
graphql-0.14.2 lib/graphql/boolean_type.rb
graphql-0.15.1 lib/graphql/boolean_type.rb
graphql-0.15.0 lib/graphql/boolean_type.rb
graphql-0.14.1 lib/graphql/boolean_type.rb
graphql-0.14.0 lib/graphql/boolean_type.rb
graphql-0.13.0 lib/graphql/boolean_type.rb
graphql-0.12.1 lib/graphql/boolean_type.rb
graphql-0.12.0 lib/graphql/boolean_type.rb