From e0e1389f3a2135cc065193d7a9075cc11a2a31cd Mon Sep 17 00:00:00 2001 From: Dirk-Jan Rutten Date: Fri, 26 May 2017 11:58:32 +0200 Subject: [PATCH] Support DateTime scalar --- spec/Section 3 -- Type System.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index 6941e20d8..c40516ca3 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -248,6 +248,25 @@ a given GraphQL server expects. Any other input value, including float input values (such as `4.0`), must raise a query error indicating an incorrect type. +#### DateTime + +The DateTime scalar represents a timestamp, represented as a string serialized +date-time conforming to the RFC 3339(https://www.ietf.org/rfc/rfc3339.txt) profile +of the ISO 8601 standard for representation of dates and times using the +Gregorian calendar. + +**Result Coercion** + +GraphQL servers should coerce both Unix timestamps and primitive date-time types +to DateTime when possible. Invalid Unix timestamps must raise a field error. + +**Input Coercion** + +When expected as an input type, only string serialized RFC 3339 date-times are +accepted. All other input values must raise a query error indicating an +incorrect type. + + ### Objects GraphQL queries are hierarchical and composed, describing a tree of information.