This commit is contained in:
Atridad Lahiji 2023-08-28 00:16:32 -06:00 committed by atridadl
parent 52b3444d4d
commit c43af63c13
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View file

@ -1,7 +1,7 @@
"use client"; "use client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { httpBatchLink } from "@trpc/client"; import { httpLink } from "@trpc/client";
import React, { useState } from "react"; import React, { useState } from "react";
import superjson from "superjson"; import superjson from "superjson";
@ -12,8 +12,8 @@ export default function Provider({ children }: { children: React.ReactNode }) {
const [trpcClient] = useState(() => const [trpcClient] = useState(() =>
trpc.createClient({ trpc.createClient({
links: [ links: [
httpBatchLink({ httpLink({
url: "http://localhost:3000/api/trpc", url: "/api/trpc",
}), }),
], ],
transformer: superjson, transformer: superjson,

View file

@ -12,6 +12,9 @@ const handler = (req: Request) =>
req, req,
router: appRouter, router: appRouter,
createContext: createTRPCContext, createContext: createTRPCContext,
batching: {
enabled: false,
},
}); });
export { handler as GET, handler as POST }; export { handler as GET, handler as POST };