?
This commit is contained in:
parent
52b3444d4d
commit
c43af63c13
2 changed files with 6 additions and 3 deletions
|
@ -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,
|
||||||
|
|
|
@ -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 };
|
||||||
|
|
Loading…
Add table
Reference in a new issue