apkt-eis/src/utils/graphql.ts

24 lines
653 B
TypeScript
Executable File

import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client/core'
export const apolloClient = () => {
const httpLink = createHttpLink({
uri: 'http://10.8.0.31:32169/graphql',
credentials: 'include', // Include credentials for cross-origin requests
});
const apolloClient = new ApolloClient({
cache: new InMemoryCache(),
link: httpLink,
headers: {
Accept: 'application/json',
'Accept-Encoding': 'gzip, deflate',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'Content-Type': 'application/json',
// Add other headers as needed
},
});
return apolloClient;
}