feature: fix Apollo client

This commit is contained in:
Sammy Teillet
2023-04-20 13:33:36 +02:00
parent 38e2e930b6
commit 7f2ec0c260
2 changed files with 5 additions and 3 deletions

View File

@ -1 +1 @@
REACT_APP_API_URL=http://localhost:3000
REACT_APP_API_URL=http://localhost:8080

View File

@ -13,11 +13,13 @@ import { setContext } from '@apollo/client/link/context';
import '@emotion/react';
import { ThemeType } from './layout/styles/themes';
const httpLink = createHttpLink({ uri: process.env.REACT_APP_API_URL });
const httpLink = createHttpLink({
uri: `${process.env.REACT_APP_API_URL}/v1/graphql`,
});
const authLink = setContext((_, { headers }) => {
return {
headers: headers,
headers: { ...headers, 'x-hasura-admin-secret': 'secret' },
};
});