We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.

Within @filter multiple functions can be used with boolean connectives.

AND, OR, and NOT

Connectives AND, OR, and NOT join filters and can be built into arbitrarily complex filters, such as (NOT A OR B) AND (C AND NOT (D OR E)). Note that, NOT binds more tightly than AND which binds more tightly than OR.

Query Example: All Steven Spielberg movies that contain either both “indiana” and “jones” OR both “jurassic” and “park”.

{
  me(func: eq(name@en, "Steven Spielberg")) @filter(has(director.film)) {
    name@en
    director.film @filter(allofterms(name@en, "jones indiana") OR allofterms(name@en, "jurassic park")) {
      uid
      name@en
    }
  }
}