UNPKG

613 BJavaScriptView Raw
1import { HttpHeaders } from '@angular/common/http';
2import { ApolloLink } from '@apollo/client/core';
3
4const httpHeaders = () => {
5 return new ApolloLink((operation, forward) => {
6 const { getContext, setContext } = operation;
7 const context = getContext();
8 if (context.headers) {
9 setContext({
10 ...context,
11 headers: new HttpHeaders(context.headers),
12 });
13 }
14 return forward(operation);
15 });
16};
17
18/**
19 * Generated bundle index. Do not edit.
20 */
21
22export { httpHeaders };
23//# sourceMappingURL=ngApolloLinkHeaders.mjs.map