From c43af63c13e52320c8cd20a62f32083f673d28d2 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Mon, 28 Aug 2023 00:16:32 -0600 Subject: [PATCH] ? --- src/app/_trpc/Provider.tsx | 6 +++--- src/app/api/trpc/[trpc]/route.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/_trpc/Provider.tsx b/src/app/_trpc/Provider.tsx index 94f47df..4f531ff 100644 --- a/src/app/_trpc/Provider.tsx +++ b/src/app/_trpc/Provider.tsx @@ -1,7 +1,7 @@ "use client"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { httpBatchLink } from "@trpc/client"; +import { httpLink } from "@trpc/client"; import React, { useState } from "react"; import superjson from "superjson"; @@ -12,8 +12,8 @@ export default function Provider({ children }: { children: React.ReactNode }) { const [trpcClient] = useState(() => trpc.createClient({ links: [ - httpBatchLink({ - url: "http://localhost:3000/api/trpc", + httpLink({ + url: "/api/trpc", }), ], transformer: superjson, diff --git a/src/app/api/trpc/[trpc]/route.ts b/src/app/api/trpc/[trpc]/route.ts index 5024554..d718e85 100644 --- a/src/app/api/trpc/[trpc]/route.ts +++ b/src/app/api/trpc/[trpc]/route.ts @@ -12,6 +12,9 @@ const handler = (req: Request) => req, router: appRouter, createContext: createTRPCContext, + batching: { + enabled: false, + }, }); export { handler as GET, handler as POST };