UNPKG

1.16 kBSource Map (JSON)View Raw
1{"version":3,"file":"ngApolloLinkHeaders.umd.js","sources":["../../headers/src/index.ts","../../headers/src/ngApolloLinkHeaders.ts"],"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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ApolloLink","HttpHeaders"],"mappings":";;;;;;QAGa,WAAW,GAAG;QACzB,OAAO,IAAIA,eAAU,CAAC,UAAC,SAAoB,EAAE,OAAiB;YACrD,IAAA,UAAU,GAAgB,SAAS,WAAzB,EAAE,UAAU,GAAI,SAAS,WAAb,CAAc;YAC3C,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;YAE7B,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,UAAU,iCACL,OAAO,KACV,OAAO,EAAE,IAAIC,gBAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IACzC,CAAC;aACJ;YAED,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;SAC3B,CAAC,CAAC;IACL;;ICjBA;;;;;;;;;;;;;;"}
\No newline at end of file