dehaze

Using Multiple Operations

Multiple operations can be used together in the same query. For example, you can filter the results, sort and limit them all in a single query.

Example: Fetch a list of trainers and only their first two Water-type pokemons sorted by their name:

query {
  trainers @mongo {
    _id
    name
    pokemons(
      where: {type: "Water"},
      sort: ["name"],
      limit: 2
    ) @mongo {
      id
      name
    }
  }
}

Have a technical question?

Improve the docs!