Sha256: 5bd7c902a525cc9b0d03b548f827605fd50b33d4406abbfb67690e15e94387b6

Contents?: true

Size: 359 Bytes

Versions: 1

Compression:

Stored size: 359 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 }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graphql-1.3.0 lib/graphql/float_type.rb