MCPcopy Create free account
hub / github.com/codemix/graph / getEdgeById

Method getEdgeById

packages/graph/src/Graph.ts:454–466  ·  view source on GitHub ↗
(
    id: ElementId,
    options?: { throwIfNotFound?: boolean },
  )

Source from the content-addressed store, hash-verified

452 options?: { throwIfNotFound?: false },
453 ): Edge<TSchema, TEdgeLabel> | undefined;
454 public getEdgeById<TEdgeLabel extends EdgeLabel<TSchema>>(
455 id: ElementId,
456 options?: { throwIfNotFound?: boolean },
457 ): Edge<TSchema, TEdgeLabel> | undefined {
458 const data = this.#config.storage.getEdgeById(id);
459 if (data === undefined) {
460 if (options?.throwIfNotFound) {
461 throw new EdgeNotFoundError(id);
462 }
463 return undefined;
464 }
465 return this.instantiateEdge<TEdgeLabel>(data);
466 }
467
468 public *getEdges<TEdgeLabel extends EdgeLabel<TSchema>>(
469 ...labels: TEdgeLabel[]

Callers 1

getElementByIdMethod · 0.95

Calls 2

instantiateEdgeMethod · 0.95
getEdgeByIdMethod · 0.65

Tested by

no test coverage detected