Date and Time Field

The Date and Time field adheres to ISO 8601 standard, outlined in th section 5.6 of RFC 3339.

Sample Date Query

Query

{
events {
start
}
}

Output

{
"data": {
"events": [
{
"start": "2020-04-01T09:00:00+00:00"
}
]
}
}

Filtering by Date and Time

Date and Time filters support:

  • _not
  • _in
  • _not_in
  • _lt
  • _lte
  • _gt
  • _gte

'start': 'DateTime'

{
events(where: { start: "2020-04-01T09:00:00+00:00" }) {
start
}
}

'start_not': 'DateTime'

{
events(where: { start_not: "2020-04-01T09:00:00+00:00" }) {
start
}
}

'start_in': '[DateTime!]'

{
events(where: { start_in: ["2020-04-01T09:00:00+00:00"] }) {
start
}
}

'start_not_in': '[DateTime!]'

{
events(where: { start_not_in: ["2020-04-01T09:00:00+00:00"] }) {
start
}
}

'start_lt': 'DateTime'

{
events(where: { start_lt: "2020-04-01T09:00:00+00:00" }) {
start
}
}

'start_lte': 'DateTime'

{
events(where: { start_lte: "2020-04-01T09:00:00+00:00" }) {
start
}
}

'start_gt': 'DateTime'

{
events(where: { start_gt: "2020-04-01T09:00:00+00:00" }) {
start
}
}

'start_gte': 'DateTime'

{
events(where: { start_gte: "2020-04-01T09:00:00+00:00" }) {
start
}
}

Mutating a Date

Mutation

mutation {
createEvent(data: { start: "2020-04-01T09:00:00+00:00" }) {
start
}
}

Output

{
"data": {
"createEvent": {
"start": "2020-04-01T09:00:00+00:00"
}
}
}

This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy