UNPKG

638 BPlain TextView Raw
1export * from 'apollo-client';
2export * from 'apollo-link';
3import { HttpLink } from 'apollo-link-http';
4export * from 'apollo-cache-inmemory';
5import { InMemoryCache, NormalizedCache } from 'apollo-cache-inmemory';
6
7import gql from 'graphql-tag';
8import ApolloClient from 'apollo-client';
9
10export { gql, InMemoryCache, HttpLink };
11
12export default class DefaultClient<
13 TCache = NormalizedCache
14> extends ApolloClient<TCache> {
15 constructor(config: any = {}) {
16 if (!config.cache) config.cache = new InMemoryCache();
17 if (!config.link) config.link = new HttpLink({ uri: '/graphql' });
18 super(config);
19 }
20}