Updated At Field

The Updated At field adheres to ISO 8601 standard, outlined in th section 5.6 of RFC 3339. This is a system field.

Sample Updated At Query

Query

{
shops {
title
updatedAt
}
}

Output

{
"data": {
"shops": [
{
"title": "Happy Valley Coffee",
"updatedAt": "2020-04-15T17:00:00+00:00"
},
{
"title": "Happy Mountain Tea",
"updatedAt": "2020-04-15T17:00:00+00:00"
},
{
"title": "Route 66 Coffee Stop",
"updatedAt": "2020-04-15T17:00:00+00:00"
},
{
"title": "Dick's Coffee",
"updatedAt": "2020-04-15T17:00:00+00:00"
}
]
}
}

Filtering by Updated At

Updated At filters support:

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

'updatedAt': 'DateTime'

{
shop(where: { updatedAt: "2020-04-01T09:00:00+00:00" }) {
title
updatedAt
}
}

'updatedAt_not': 'DateTime'

{
shop(where: { updatedAt_not: "2020-04-01T09:00:00+00:00" }) {
title
updatedAt
}
}

'updatedAt_in': '[DateTime!]'

{
shop(where: { updatedAt_in: ["2020-04-01T09:00:00+00:00"] }) {
title
updatedAt
}
}

'updatedAt_not_in': '[DateTime!]'

{
shop(where: { updatedAt_not_in: ["2020-04-01T09:00:00+00:00"] }) {
title
updatedAt
}
}

'updatedAt_lt': 'DateTime'

{
shop(where: { updatedAt_lt: "2020-04-01T09:00:00+00:00" }) {
title
updatedAt
}
}

'updatedAt_lte': 'DateTime'

{
shop(where: { updatedAt_lte: "2020-04-01T09:00:00+00:00" }) {
title
updatedAt
}
}

'updatedAt_gt': 'DateTime'

{
shop(where: { updatedAt_gt: "2020-04-01T09:00:00+00:00" }) {
title
updatedAt
}
}

'updatedAt_gte': 'DateTime'

{
shop(where: { updatedAt_gte: "2020-04-01T09:00:00+00:00" }) {
title
updatedAt
}
}

Mutating a Date

This is a system field and the values will be generated for you if left blank

Mutation

mutation {
createShop(
data: { title: "Dick's Coffee", updatedAt: "2020-04-15T17:00:00+00:00" }
) {
title
updatedAt
}
}

Output

{
"data": {
"createShop": {
"title": "Dick's Coffee",
"updatedAt": "2020-04-15T17:00:00+00:00"
}
}
}

Were you expecting something more?

We are constantly contributing to our documentation, but if you spot something we're missing, let us know and we'll be sure to add it.

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