UNPKG

@enface/sdk

Version:

Enface biometric services

27 lines (25 loc) 703 B
import { ApolloClient } from 'apollo-client'; import { ApolloLink } from 'apollo-link'; import { InMemoryCache } from 'apollo-cache-inmemory'; import { createUploadLink } from './upload-link'; export const apolloClient = (url, apiKey) => { const uploadLink = createUploadLink({ uri: url, }); const client = new ApolloClient({ link: ApolloLink.from([uploadLink]), cache: new InMemoryCache(), defaultOptions: { watchQuery: { fetchPolicy: 'network-only', errorPolicy: 'ignore', }, query: { fetchPolicy: 'network-only', errorPolicy: 'all', }, }, }); client.apiKey = apiKey; return client; };