UNPKG

599 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(Object.assign(Object.assign({}, context), { headers: new HttpHeaders(context.headers) }));
10 }
11 return forward(operation);
12 });
13};
14
15/**
16 * Generated bundle index. Do not edit.
17 */
18
19export { httpHeaders };
20//# sourceMappingURL=ngApolloLinkHeaders.mjs.map