* 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>[])
| 116 | * @throws ReadonlyGraphError if a mutation step is found. |
| 117 | */ |
| 118 | function 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 | |
| 129 | export interface ParseQueryToStepsOptions { |
| 130 | /** |
no test coverage detected