apollo-client-preset
Version:
Core abstract of Caching layer for Apollo Client
41 lines • 1.73 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("apollo-client"));
__export(require("apollo-link"));
var apollo_link_http_1 = require("apollo-link-http");
exports.HttpLink = apollo_link_http_1.HttpLink;
__export(require("apollo-cache-inmemory"));
var apollo_cache_inmemory_1 = require("apollo-cache-inmemory");
exports.InMemoryCache = apollo_cache_inmemory_1.InMemoryCache;
var graphql_tag_1 = require("graphql-tag");
exports.gql = graphql_tag_1.default;
var apollo_client_1 = require("apollo-client");
var DefaultClient = (function (_super) {
__extends(DefaultClient, _super);
function DefaultClient(config) {
if (config === void 0) { config = {}; }
var _this = this;
if (!config.cache)
config.cache = new apollo_cache_inmemory_1.InMemoryCache();
if (!config.link)
config.link = new apollo_link_http_1.HttpLink({ uri: '/graphql' });
_this = _super.call(this, config) || this;
return _this;
}
return DefaultClient;
}(apollo_client_1.default));
exports.default = DefaultClient;
//# sourceMappingURL=index.js.map