( queryString: string, options?: ParseQueryToStepsOptions, )
| 143 | * @param options.readonly When true, throws ReadonlyGraphError if the query contains mutation steps. |
| 144 | */ |
| 145 | export function parseQueryToSteps( |
| 146 | queryString: string, |
| 147 | options?: ParseQueryToStepsOptions, |
| 148 | ): { |
| 149 | steps: readonly Step<any>[]; |
| 150 | postprocess: (row: readonly unknown[]) => Record<string, unknown>; |
| 151 | } { |
| 152 | const ast = parse(queryString) as Query | UnionQuery | MultiStatement; |
| 153 | const steps = anyAstToSteps(ast); |
| 154 | |
| 155 | if (options?.readonly) { |
| 156 | validateNoMutations(steps); |
| 157 | } |
| 158 | |
| 159 | return { steps, postprocess: createPostprocessor(ast) }; |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Creates a function which takes the array of values returned by the graph traversal |
no test coverage detected