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.7.7 lib/graphql/float_type.rb
graphql-1.8.0.pre1 lib/graphql/float_type.rb
graphql-1.7.6 lib/graphql/float_type.rb
graphql-1.7.5 lib/graphql/float_type.rb
graphql-1.7.4 lib/graphql/float_type.rb
graphql-1.7.3 lib/graphql/float_type.rb
graphql-1.7.2 lib/graphql/float_type.rb
graphql-1.7.1 lib/graphql/float_type.rb
graphql-1.7.0 lib/graphql/float_type.rb
graphql-1.6.8 lib/graphql/float_type.rb
graphql-1.6.7 lib/graphql/float_type.rb
graphql-1.6.6 lib/graphql/float_type.rb
graphql-1.6.5 lib/graphql/float_type.rb
graphql-1.6.4 lib/graphql/float_type.rb
graphql-1.5.15 lib/graphql/float_type.rb
graphql-1.6.3 lib/graphql/float_type.rb
graphql-1.6.2 lib/graphql/float_type.rb
graphql-1.6.1 lib/graphql/float_type.rb
graphql-1.6.0 lib/graphql/float_type.rb
graphql-1.5.14 lib/graphql/float_type.rb