From 6febe13b3f4ad4eff3f205ece445b3577255bf41 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 16 Feb 2024 20:33:00 +0000
Subject: Migrating to react query for client side queries

---
 packages/web/lib/trpc.tsx | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

(limited to 'packages/web/lib/trpc.tsx')

diff --git a/packages/web/lib/trpc.tsx b/packages/web/lib/trpc.tsx
index 540c6ab5..aa246047 100644
--- a/packages/web/lib/trpc.tsx
+++ b/packages/web/lib/trpc.tsx
@@ -1,20 +1,5 @@
 "use client";
-import { httpBatchLink } from "@trpc/client";
 import type { AppRouter } from "@/server/api/routers/_app";
+import { createTRPCReact } from "@trpc/react-query";
 
-import { loggerLink } from "@trpc/client";
-import { createTRPCClient } from "@trpc/client";
-
-export const api = createTRPCClient<AppRouter>({
-  links: [
-    loggerLink({
-      enabled: (op) =>
-        process.env.NODE_ENV === "development" ||
-        (op.direction === "down" && op.result instanceof Error),
-    }),
-    httpBatchLink({
-      // TODO: Change this to be a full URL exposed as a client side setting
-      url: `/api/trpc`,
-    }),
-  ],
-});
+export const api = createTRPCReact<AppRouter>();
-- 
cgit v1.2.3-70-g09d2

