Class ZeroToManyRelationCountLoader

The 0:many connected vertices counts data loader.

This class aggregates multiple 0:many relationships counters retrievals into a single Gremlin query.

The logic is similar to the ZeroToManyRelationVertexLoader; in most cases, while not guaranteed, counters and vertices queries would be aggregated by same keys.

Check ZeroToManyRelationLoaderDataLoaderId type and serializeDataLoaderId method for details on what properties are used for aggregating queries.

Mermaid

Retrieving 0:many connections counters

%%{init:{"theme":"dark"}}%% sequenceDiagram participant Resolvers participant ZeroToManyRelationCountLoader participant Graph database Resolvers->>ZeroToManyRelationCountLoader: Retrieve
%%{init:{"theme":"default"}}%% sequenceDiagram participant Resolvers participant ZeroToManyRelationCountLoader participant Graph database Resolvers->>ZeroToManyRelationCountLoader: Retrieve
sequenceDiagram
    participant Resolvers
    participant ZeroToManyRelationCountLoader
    participant Graph database
    Resolvers->>ZeroToManyRelationCountLoader: Retrieve
`a` connections count for vertex 1 ZeroToManyRelationCountLoader->>Resolvers: Promise Resolvers->>ZeroToManyRelationCountLoader: Retrieve `a` connections count for vertex 2 ZeroToManyRelationCountLoader->>Resolvers: Promise Resolvers->>ZeroToManyRelationCountLoader: Retrieve `a` connections count for vertex 3 ZeroToManyRelationCountLoader->>Resolvers: Promise Resolvers->>ZeroToManyRelationCountLoader: Retrieve `b` connections count for vertex 4 ZeroToManyRelationCountLoader->>Resolvers: Promise activate ZeroToManyRelationCountLoader Note left of ZeroToManyRelationCountLoader: Aggregates requests until next event loop tick ZeroToManyRelationCountLoader->>Graph database: Retrieve count of `a` connections for vertices 1, 2, 3 ZeroToManyRelationCountLoader->>Graph database: Retrieve count of `b` connections for vertex 4 Graph database->>ZeroToManyRelationCountLoader: Response: connections count for vertices 1, 2, 3 Graph database->>ZeroToManyRelationCountLoader: Response: connections count for vertex 4 Note left of ZeroToManyRelationCountLoader: Resolves Promises deactivate ZeroToManyRelationCountLoader ZeroToManyRelationCountLoader->>Resolvers: `a` connections count for vertex 1 ZeroToManyRelationCountLoader->>Resolvers: `a` connections count for vertex 2 ZeroToManyRelationCountLoader->>Resolvers: `a` connections count for vertex 3 ZeroToManyRelationCountLoader->>Resolvers: `b` connections count for vertex 4

Hierarchy

Constructors

Properties

graphConnector: GraphConnector
search: Search

Methods

Generated using TypeDoc