Skip to content

Instantly share code, notes, and snippets.

@pablohpsilva
Created September 11, 2019 20:10
Show Gist options
  • Save pablohpsilva/586520004a3fd8850aca59ff9e8e76ad to your computer and use it in GitHub Desktop.
Save pablohpsilva/586520004a3fd8850aca59ff9e8e76ad to your computer and use it in GitHub Desktop.
sample medium client dh-apollo-entities
import { ApolloClient } from 'apollo-client'
import { ApolloLink } from 'apollo-link'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { ApiGw, User } from 'dh-apollo-entities'
const cache = new InMemoryCache()
const ApiGwLink = ApiGw.link({
...
})
const UserLink = User.link({
...
cache
})
export const client = new ApolloClient({
link: ApolloLink.from([ApiGwLink, UserLink]),
cache,
...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment