graphql-ruby, Date or Datetime type : <p>I'm not the only one who doesn't know how to use <code>Datetime</code> types with GraphQL-Ruby: <a href="https://github.com/rmosolgo/graphql-ruby-demo/issues/27" rel="noreferrer">https://github.com/rmosolgo/graphql-ruby-demo/issues/27</a>, as you can see there are 18 people like me.</p>

<p>How can I use Datetime to some fields like this?</p>

<pre><code>Types::PlayerType = GraphQL::ObjectType.define do
  name 'Player'

  field :id, !types.ID
  field :birth_date, types.Datetime #or what?
  field :death_date, !types.Datetime #or what?
  field :note, types.String
end
</code></pre>

<p>Maybe I have to use this (<a href="https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/date_time_type.rb" rel="noreferrer">https://github.com/howtographql/graphql-ruby/blob/master/app/graphql/types/date_time_type.rb</a>):</p>

<p><strong>date_time_type.rb</strong>:</p>

<pre><code>Types::DateTimeType = GraphQL::ScalarType.define do
  name 'DateTime'

  coerce_input -&gt;(value, _ctx) { Time.zone.parse(value) }
  coerce_result -&gt;(value, _ctx) { value.utc.iso8601 }
end
</code></pre>

<p><strong>Can someone explain it better?</strong></p>
