DefinitionsΒΆ
Vertex field: A field corresponding to a vertex in the graph. In the below example,
Animalandout_Entity_Relatedare vertex fields. TheAnimalfield is the field at which querying starts, and is therefore the root vertex field. In any scope, fields with the prefixout_denote vertex fields connected by an outbound edge, whereas ones with the prefixin_denote vertex fields connected by an inbound edge.{ Animal { name @output(out_name: "name") out_Entity_Related { ... on Species { description @output(out_name: "description") } } } }
Property field: A field corresponding to a property of a vertex in the graph. In the above example, the
nameanddescriptionfields are property fields. In any given scope, property fields must appear before vertex fields.Result set: An assignment of vertices in the graph to scopes (locations) in the query. As the database processes the query, new result sets may be created (e.g. when traversing edges), and result sets may be discarded when they do not satisfy filters or type coercions. After all parts of the query are processed by the database, all remaining result sets are used to form the query result, by taking their values at all properties marked for output.
Scope: The part of a query between any pair of curly braces. The compiler infers the type of each scope. For example, in the above query, the scope beginning with
Animal {is of typeAnimal, the one beginning without_Entity_Related {is of typeEntity, and the one beginning with... on Species {is of typeSpecies.Type coercion: An operation that produces a new scope of narrower type than the scope in which it exists. Any result sets that cannot satisfy the narrower type are filtered out and not returned. In the above query,
... on Speciesis a type coercion which takes its enclosing scope of typeEntity, and coerces it into a narrower scope of typeSpecies. This is possible sinceEntityis an interface, andSpeciesis a type that implements theEntityinterface.