UNPKG

930 BSource Map (JSON)View Raw
1{"version":3,"sources":["../../headers/src/index.ts"],"names":["ApolloLink","operation","forward","getContext","setContext","context","headers","Object","assign","HttpHeaders"],"mappings":"mcAG2B,WACzB,OAAO,IAAIA,EAAAA,YAAW,SAACC,EAAsBC,GACpC,IAAAC,EAA0BF,EAASE,WAAvBC,EAAcH,EAASG,WACpCC,EAAUF,IAShB,OAPIE,EAAQC,SACVF,EAAUG,OAAAC,OAAAD,OAAAC,OAAA,GACLH,GAAO,CACVC,QAAS,IAAIG,EAAAA,YAAYJ,EAAQC,YAI9BJ,EAAQD","sourcesContent":["import {HttpHeaders} from '@angular/common/http';\nimport {ApolloLink, Operation, NextLink} from '@apollo/client/core';\n\nexport const httpHeaders = () => {\n return new ApolloLink((operation: Operation, forward: NextLink) => {\n const {getContext, setContext} = operation;\n const context = getContext();\n\n if (context.headers) {\n setContext({\n ...context,\n headers: new HttpHeaders(context.headers),\n });\n }\n\n return forward(operation);\n });\n};\n"]}
\No newline at end of file