DateTime scalar now available

DateTime scalar now available

We're extremely happy to announce the release of the DateTime scalar.

You can now mark fields in your models as DateTime. This new scalar uses the ISO 8601 standard. ISO 8601 represents date and time by starting with the year, followed by the month, day, hour, minutes, seconds and milliseconds.

You can read more about this within the document rfc3339.

Here's how you can use it:

type Event @model { title: String! starts: DateTime! ends: DateTime }

When mutating data, in the case of the above schema, you'll want to pass the ISO 8601 format to the input type:

mutation { eventCreate( input: { title: "Grafbase DateTime Scalar Party" starts: "2022-08-17T13:43:30Z" } ) { event { id title starts } } }

You'll then get a response that looks something like the following, including the DateTime response:

{ "data": { "eventCreate": { "event": { "id": "event_01GANRQA0NBMPKA0W3QCYJXXFC", "title": "Grafbase DateTime Scalar Party", "starts": "2022-08-17T13:43:30Z" } } } }
  • Grafbase CLI 0.5.0 has been released to include all of the above. If upgrading from versions before 0.4.0 you'll want to delete the .grafbase folder.
  • Grafbase CLI now has a reset command to remove all local project data.

We'd love to hear your feedback and ideas, so join us on Discord.