We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5041dca commit 0525a68Copy full SHA for 0525a68
dashboard/src/lib/apollo.tsx
@@ -95,8 +95,13 @@ function createApolloClient(initialState = {}) {
95
const ssrMode = typeof window === 'undefined';
96
const cache = new InMemoryCache().restore(initialState);
97
98
+ let apiUrl = process.env.API_URL;
99
+ if (typeof window !== 'undefined') {
100
+ apiUrl = `${window.location.protocol}//${window.location.host}/graphql`;
101
+ }
102
+
103
const httpLink = new HttpLink({
- uri: process.env.API_URL,
104
+ uri: apiUrl,
105
credentials: 'same-origin',
106
fetch,
107
});
0 commit comments