UNPKG

apollo-angular

Version:

Use your GraphQL data in your Angular app, with the Apollo Client

28 lines (22 loc) 1.28 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@apollo/client/core')) : typeof define === 'function' && define.amd ? define('apollo-angular/headers', ['exports', '@angular/common/http', '@apollo/client/core'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngApollo = global.ngApollo || {}, global.ngApollo.headers = {}), global.ng.common.http, global.core)); }(this, (function (exports, http, core) { 'use strict'; var httpHeaders = function () { return new core.ApolloLink(function (operation, forward) { var getContext = operation.getContext, setContext = operation.setContext; var context = getContext(); if (context.headers) { setContext(Object.assign(Object.assign({}, context), { headers: new http.HttpHeaders(context.headers) })); } return forward(operation); }); }; /** * Generated bundle index. Do not edit. */ exports.httpHeaders = httpHeaders; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=ngApolloLinkHeaders.umd.js.map