2018-05-23 07:55:14 +00:00
|
|
|
module Types
|
|
|
|
class TimeType < BaseScalar
|
|
|
|
graphql_name 'Time'
|
|
|
|
description 'Time represented in ISO 8601'
|
2017-08-16 13:04:41 +00:00
|
|
|
|
2018-05-23 07:55:14 +00:00
|
|
|
def self.coerce_input(value, ctx)
|
|
|
|
Time.parse(value)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.coerce_result(value, ctx)
|
|
|
|
value.iso8601
|
|
|
|
end
|
|
|
|
end
|
2017-08-16 13:04:41 +00:00
|
|
|
end
|