From eb614c3a58f3a9a2811608a54b228fb733946664 Mon Sep 17 00:00:00 2001 From: Martin Alexander Kaminski Date: Sun, 4 Oct 2026 17:06:36 +0200 Subject: [PATCH 01/18] feat: add Apollo Client --- frontend/app/root.tsx | 25 +++++--- frontend/package.json | 3 + frontend/pnpm-lock.yaml | 123 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 7 deletions(-) diff --git a/frontend/app/root.tsx b/frontend/app/root.tsx index 105fe1d..e0e1f57 100644 --- a/frontend/app/root.tsx +++ b/frontend/app/root.tsx @@ -12,6 +12,10 @@ import { } from "react-router"; import { MainLoading } from "~/components/MainLoading/MainLoading"; import type { Route } from "./+types/root"; +import { ApolloClient } from "@apollo/client"; +import { HttpLink } from "@apollo/client"; +import { InMemoryCache } from "@apollo/client"; +import { ApolloProvider } from "@apollo/client/react"; // Created outside the component tree so the cache survives re-renders. // With the help of claude, these were the default options that suited our needs the best. @@ -30,6 +34,11 @@ const queryClient = new QueryClient({ }, }); +const apolloClient = new ApolloClient({ + link: new HttpLink({ uri: "http://localhost:3001/graphql" }), + cache: new InMemoryCache(), +}); + export function HydrateFallback() { return ; } @@ -69,13 +78,15 @@ export function Layout({ children }: { children: React.ReactNode }) { - -
- {children} -