Date
A date string, such as 2007-12-03
, is compliant with the full-date
format outlined in section
5.6 of the RFC 3339 profile of the ISO 8601 standard for the representation of dates and times using
the Gregorian calendar.
This scalar is a description of the date, as used for birthdays for example. It cannot represent an instant on the timeline.
Result Coercion
JavaScript Date instances are coerced to an RFC 3339 compliant date string, taken at the UTC timezone. Invalid Date instances raise a field error.
Examples:
new Date('2023-02-03T01:00:00Z') // 2023-02-03
new Date('2023-02-03T01:00:00+0500') // 2023-02-02
Input Coercion
When expected as an input type, only RFC 3339 compliant date strings are accepted, and are parsed
into Date
objects at midnight UTC. All other input values raise a query error indicating an
incorrect type.