Sha256: e267849ebeee6c2ece1a717aad8de6bccd5dbe8c1bf4a813c2d7f415039ee5fd

Contents?: true

Size: 381 Bytes

Versions: 9

Compression:

Stored size: 381 Bytes

Contents

# frozen_string_literal: true
GraphQL::FLOAT_TYPE = GraphQL::ScalarType.define do
  name "Float"
  description "Represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point)."

  coerce_input ->(value) { value.is_a?(Numeric) ? value.to_f : nil }
  coerce_result ->(value) { value.to_f }
  default_scalar true
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql-1.5.5 lib/graphql/float_type.rb
graphql-1.5.4 lib/graphql/float_type.rb
graphql-1.5.3 lib/graphql/float_type.rb
graphql-1.4.5 lib/graphql/float_type.rb
graphql-1.4.4 lib/graphql/float_type.rb
graphql-1.4.3 lib/graphql/float_type.rb
graphql-1.4.2 lib/graphql/float_type.rb
graphql-1.4.1 lib/graphql/float_type.rb
graphql-1.4.0 lib/graphql/float_type.rb