Sha256: 1ff5004cae610be8ef53244e84a38c0c8ac1ccaa89a2a1df3fbaefb979043150
Contents?: true
Size: 571 Bytes
Versions: 41
Compression:
Stored size: 571 Bytes
Contents
# frozen_string_literal: true module Platform module Scalars DateTime = GraphQL::ScalarType.define do name "DateTime" description "An ISO-8601 encoded UTC date string." # rubocop:disable Layout/SpaceInLambdaLiteral coerce_input -> (value, context) do begin Time.iso8601(value) rescue ArgumentError, ::TypeError end end # rubocop:enable Layout/SpaceInLambdaLiteral coerce_result ->(value, context) do return nil unless value value.utc.iso8601 end end end end
Version data entries
41 entries across 41 versions & 1 rubygems