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

Method deleteEdge

packages/graph/src/Graph.ts:649–658  ·  view source on GitHub ↗

* Delete an edge from the graph. * @param id The id of the edge to delete, or the edge itself.

(id: ElementId | Edge<TSchema, any>)

Source from the content-addressed store, hash-verified

647 * @param id The id of the edge to delete, or the edge itself.
648 */
649 public deleteEdge(id: ElementId | Edge<TSchema, any>): void {
650 if (typeof id === "object") {
651 id = id.id;
652 }
653 const edge = this.#config.storage.getEdgeById(id);
654 if (edge) {
655 this.#indexManager.onElementRemove(edge);
656 }
657 this.#config.storage.deleteEdge(id);
658 }
659
660 /**
661 * Update a property of a vertex or edge.

Callers

nothing calls this directly

Calls 3

onElementRemoveMethod · 0.80
getEdgeByIdMethod · 0.65
deleteEdgeMethod · 0.65

Tested by

no test coverage detected