import { graph } from "@/lib/papers/queries"; import { json, limited, tooMany } from "@/lib/api"; export async function GET(req: Request) { if (limited(req, "api")) return tooMany(); const kinds = new URL(req.url).searchParams.get("kinds")?.split(",").filter(Boolean); return json(await graph(kinds?.length ? kinds : undefined), { maxAge: 120 }); }