Skip to main content
Version: Next

QuerySingle <T>

A QuerySingle is a Query which follows relations that should be unique between data types (0..1 and 1..1 cardinalities). It returns the instance related to the origin, following the specified relation(s).

It acts as a syntactic sugar to avoid having a query result structure and get the first value out of it.

A QuerySingle is immutable.

Index

Constructors

constructor

Methods

cast

execute

  • execute(context: Context): Promise<T>
  • Execute the query single, see Query.execute()


    Parameters

    Returns Promise<T>

    promise containing the single result or null

executeFromCache

  • executeFromCache(): T

follow

staticfrom

  • Create a query single from a single node. See Query.from


    Type parameters

    Parameters

    • object: Tag

      starting node for the graph query single

    Returns QuerySingle<T>

    new query single only accepting 0..1 relations