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

Function convertRemoveClause

packages/graph/src/astToSteps.ts:727–745  ·  view source on GitHub ↗

* Convert a REMOVE clause into a RemoveStep.

(removeClause: RemoveClause)

Source from the content-addressed store, hash-verified

725 * Convert a REMOVE clause into a RemoveStep.
726 */
727function convertRemoveClause(removeClause: RemoveClause): RemoveStep {
728 const items: RemoveStepItem[] = removeClause.items.map((item) => {
729 if (item.type === "RemoveProperty") {
730 return {
731 type: "property" as const,
732 variable: item.variable,
733 property: item.property,
734 };
735 } else {
736 // Label removal is not supported - validate early
737 throw new Error(
738 `REMOVE: Label removal is not supported. Labels are immutable. ` +
739 `Cannot remove label '${item.label}' from '${item.variable}'.`,
740 );
741 }
742 });
743
744 return new RemoveStep({ items });
745}
746
747/**
748 * Convert a MERGE clause into a MergeStep.

Callers 2

processQuerySegmentsFunction · 0.85
processLegacyQueryFunction · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected