GraphQL+ query for datetime delta/duration

Is it possible to query for the duration between two datetimes? I see that the subtraction operator doesn’t apply to the datetime type.

You can do something like this: (Run in

  var(func:allofterms(name@en, "steven spielberg")) {
    films as {
      p as count(starring)
      q as count(genre)
      date as initial_release_date
      years as math(since(date)/(365*24*60*60))
      score as math(cond(years > 10, 0, ln(p)+q-ln(years)))

  TopMovies(func: uid(films), orderasc: val(years)) #@filter(gt(val(score), 2))
  @filter(gt(val(years), 6) and le(val(years), 14))

A post was split to a new topic: Calculating interval