Visualizando todo grafo com anzograph

This commit is contained in:
Oxy8
2026-03-10 17:21:47 -03:00
parent a0c5bec19f
commit 5badcd8d6f
17 changed files with 482 additions and 106 deletions

View File

@@ -43,7 +43,18 @@ export default function App() {
setStatus("Fetching graph…");
const graphRes = await fetch(`/api/graph?graph_query_id=${encodeURIComponent(graphQueryId)}`, { signal });
if (!graphRes.ok) throw new Error(`Failed to fetch graph: ${graphRes.status}`);
if (!graphRes.ok) {
let detail = "";
try {
const err = await graphRes.json();
if (err && typeof err === "object" && typeof (err as any).detail === "string") {
detail = (err as any).detail;
}
} catch {
// ignore
}
throw new Error(`Failed to fetch graph: ${graphRes.status}${detail ? ` (${detail})` : ""}`);
}
const graph = await graphRes.json();
if (signal.aborted) return;