Files
apkt-eis/src/utils/graphql.ts
Dede Fuji Abdul c96988f97f Add Apollo Client and GraphQL dependencies, and
create Apollo Client instance.
2023-11-08 15:33:49 +07:00

16 lines
403 B
TypeScript

import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client/core'
// HTTP connection to the API
const httpLink = createHttpLink({
// You should use an absolute URL here
uri: 'http://localhost:3020/graphql',
})
// Cache implementation
const cache = new InMemoryCache()
// Create the apollo client
export const apolloClient = new ApolloClient({
link: httpLink,
cache,
})