Sha256: f94d397b8acc7d53137b033305c2ac009a29728a607aea911a5d415f0d5b56eb

Contents?: true

Size: 393 Bytes

Versions: 49

Compression:

Stored size: 393 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, _ctx) { value.is_a?(Numeric) ? value.to_f : nil }
  coerce_result ->(value, _ctx) { value.to_f }
  default_scalar true
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
graphql-1.8.2 lib/graphql/float_type.rb
graphql-1.8.1 lib/graphql/float_type.rb
graphql-1.8.0 lib/graphql/float_type.rb
graphql-1.8.0.pre11 lib/graphql/float_type.rb
graphql-1.8.0.pre10 lib/graphql/float_type.rb
graphql-1.7.14 lib/graphql/float_type.rb
graphql-1.8.0.pre9 lib/graphql/float_type.rb
graphql-1.8.0.pre8 lib/graphql/float_type.rb
graphql-1.7.13 lib/graphql/float_type.rb
graphql-1.8.0.pre7 lib/graphql/float_type.rb
graphql-1.7.12 lib/graphql/float_type.rb
graphql-1.7.11 lib/graphql/float_type.rb
graphql-1.7.10 lib/graphql/float_type.rb
graphql-1.8.0.pre6 lib/graphql/float_type.rb
graphql-1.8.0.pre5 lib/graphql/float_type.rb
graphql-1.7.9 lib/graphql/float_type.rb
graphql-1.8.0.pre4 lib/graphql/float_type.rb
graphql-1.8.0.pre3 lib/graphql/float_type.rb
graphql-1.7.8 lib/graphql/float_type.rb
graphql-1.8.0.pre2 lib/graphql/float_type.rb