Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions client/src/apollo/client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';

// GraphQL server address. Override with VITE_GRAPHQL_URL in .env (e.g. on the VM)
const uri = import.meta.env.VITE_GRAPHQL_URL ?? '/project2/graphql';;
// GraphQL server address. Override with VITE_GRAPHQL_URL in .env if needed.
// Dev: the local backend. Production build: Apache forwards /project2/graphql to the backend on the VM.
const uri =
import.meta.env.VITE_GRAPHQL_URL ??
(import.meta.env.DEV ? 'http://localhost:3001/graphql' : '/project2/graphql');

export const client = new ApolloClient({
link: new HttpLink({ uri }), // how requests reach the server
Expand Down