Sha256: d721379c3f766f550b273a4267bc5ef4cb70691eeb1473eca5eacf100f025ce3

Contents?: true

Size: 329 Bytes

Versions: 10

Compression:

Stored size: 329 Bytes

Contents

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 }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
graphql-1.2.6 lib/graphql/float_type.rb
graphql-1.2.5 lib/graphql/float_type.rb
graphql-1.2.4 lib/graphql/float_type.rb
graphql-1.2.3 lib/graphql/float_type.rb
graphql-1.2.2 lib/graphql/float_type.rb
graphql-1.2.1 lib/graphql/float_type.rb
graphql-1.2.0 lib/graphql/float_type.rb
graphql-1.1.0 lib/graphql/float_type.rb
graphql-1.0.0 lib/graphql/float_type.rb
graphql-0.19.4 lib/graphql/float_type.rb