| 28 | const ROW_CAP = 300; |
| 29 | |
| 30 | function queryText(query: RouteQuery): string { |
| 31 | // Only fixed schema labels enter Cypher; project is a separate RPC argument. |
| 32 | return `MATCH (s:${query.source})-[r:${query.relations}]->(t:${query.target}) RETURN ` |
| 33 | + 'id(s) AS source, s.qualified_name AS source_qn, s.file_path AS source_file, ' |
| 34 | + 's.start_line AS source_line, s.name AS source_name, id(t) AS target, ' |
| 35 | + 't.qualified_name AS target_qn, t.file_path AS target_file, t.start_line AS target_line, ' |
| 36 | + 't.name AS target_name, id(r) AS edge_id, type(r) AS edge_type, ' |
| 37 | + `r.url_path AS route_path, r.via AS via LIMIT ${ROW_CAP + 1}`; |
| 38 | } |
| 39 | |
| 40 | const clean = (value: string | undefined) => value && value !== '{}' && value !== '-' ? value : undefined; |
| 41 | function integer(value: string | undefined): number | undefined { |