1 | export * from 'apollo-client';
|
2 | export * from 'apollo-link';
|
3 | import { HttpLink } from 'apollo-link-http';
|
4 | export * from 'apollo-cache-inmemory';
|
5 | import { InMemoryCache, NormalizedCache } from 'apollo-cache-inmemory';
|
6 |
|
7 | import gql from 'graphql-tag';
|
8 | import ApolloClient from 'apollo-client';
|
9 |
|
10 | export { gql, InMemoryCache, HttpLink };
|
11 |
|
12 | export 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 | }
|