Skip to main content
Version: Next

Query Follow Relation

Fetches the objects that are related to the current list of objects

Description

Adds a clause to a query to fetch objects which are related to the objects retrieved from the input query.

Example

Let's say that Car has a relation to Passenger which has a relation to Family.

Car --> Passenger --> Family

Then from a query that retrieves Cars we can use Query Follow Relation to first retrieve all Passengers, and then once more to retrieve all Families from a set of Cars.

If add to result is set to true on both Query Follow Relation, then the Passenger is added to the end result, such that the result therefore contains [Passenger, Family] pairs.

Setting to origin to true allows following relations backwards, e.g. from Passengers to Cars.

Inputs

  • query (Query): The query to which the relation must be added
  • relation (Relation): The relation to follow
  • add to result (Boolean): See main description
  • to origin (Boolean): Follows the relation in reverse (see main description)

Outputs

  • query (Query): The augmented query