import type { GraphQueryMeta } from "./types";

export async function fetchGraphQueries(signal?: AbortSignal): Promise<GraphQueryMeta[]> {
  const res = await fetch("/api/graph_queries", { signal });
  if (!res.ok) throw new Error(`GET /api/graph_queries failed: ${res.status}`);
  const data = await res.json();
  return Array.isArray(data) ? (data as GraphQueryMeta[]) : [];
}

