Skip to content

[RFC] Support DateTime scalar #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down