apollo.ts
1import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client";
2
3const httpLink = new HttpLink({
4 uri: "/graphql",
5 // include credentials so future httpOnly auth cookies are sent automatically
6 credentials: "include",
7});
8
9export const client = new ApolloClient({
10 link: httpLink,
11
12 cache: new InMemoryCache({
13 typePolicies: {
14 // Repository has no id field — treat as a singleton per cache
15 Repository: {
16 keyFields: [],
17 },
18 },
19 }),
20});