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

Function validateNoMutations

packages/graph/src/index.ts:118–127  ·  view source on GitHub ↗

* Validates that a step array contains no mutation steps. * Recursively checks ContainerStep subclasses for nested mutations. * @throws ReadonlyGraphError if a mutation step is found.

(steps: readonly Step<any>[])

Source from the content-addressed store, hash-verified

116 * @throws ReadonlyGraphError if a mutation step is found.
117 */
118function validateNoMutations(steps: readonly Step<any>[]): void {
119 for (const step of steps) {
120 if (MUTATION_STEP_NAMES.has(step.name)) {
121 throw new ReadonlyGraphError(step.name);
122 }
123 if (step instanceof ContainerStep) {
124 validateNoMutations(step.steps);
125 }
126 }
127}
128
129export interface ParseQueryToStepsOptions {
130 /**

Callers 1

parseQueryToStepsFunction · 0.85

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected