16 lines
403 B
TypeScript
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,
|
|
}) |