ra-data-graphql
Version:
A GraphQL data provider for react-admin
18 lines • 676 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const client_1 = require("@apollo/client");
exports.default = (options) => {
if (!options) {
return new client_1.ApolloClient({
cache: new client_1.InMemoryCache().restore({}),
});
}
const { cache = new client_1.InMemoryCache().restore({}), uri, credentials, headers, link = uri ? new client_1.HttpLink({ uri, credentials, headers }) : undefined, ...otherOptions } = options;
return new client_1.ApolloClient({
link,
cache,
...otherOptions,
});
};
module.exports = exports.default;
//# sourceMappingURL=buildApolloClient.js.map