import { type WeavyType } from "../client/weavy"; /// GET chat app export async function getFeatures(weavy: WeavyType, type: string) { if (!weavy) { throw new Error("getFeatures must be used within a WeavyContext"); } const queryClient = weavy.queryClient; return await queryClient.fetchQuery({ queryKey: ["features", type], queryFn: async () => { const response = await weavy.fetch("/api/features/" + type); return await response.json() as T; }, }); }