Files
apkt-eis/src/utils/graphql.ts
2024-02-24 14:50:44 +07:00

24 lines
655 B
TypeScript
Executable File

import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client/core'
export const apolloClient = () => {
const httpLink = createHttpLink({
uri: 'http://10.1.50.173:32180/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;
}