sendou.ink/utils/trpc.ts
2021-03-08 22:04:09 +02:00

15 lines
401 B
TypeScript

import { createReactQueryHooks, createTRPCClient } from "@trpc/react";
import type { AppRouter } from "pages/api/trpc/[trpc]";
import { QueryClient } from "react-query";
import superjson from "superjson";
export const client = createTRPCClient<AppRouter>({
url: "/api/trpc",
transformer: superjson,
});
export const trpc = createReactQueryHooks({
client,
queryClient: new QueryClient(),
});