UNPKG

@apollo-orbit/angular

Version:

A fully-featured GraphQL client for Angular with modular state management.

1 lines 1.72 kB
{"version":3,"file":"apollo-orbit.angular.http.mjs","sources":["../../http/src/httpLinkFactory.ts","../../http/src/providers.ts","../../http/src/apollo-orbit.angular.http.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { makeFetch } from '@apollo-orbit/angular/fetch';\r\nimport { HttpLink, HttpOptions } from '@apollo/client/link/http';\r\n\r\n@Injectable()\r\nexport class HttpLinkFactory {\r\n public constructor(\r\n private readonly httpClient: HttpClient\r\n ) { }\r\n\r\n public create(options: HttpOptions = {}): HttpLink {\r\n return new HttpLink({\r\n ...options,\r\n fetch: makeFetch(this.httpClient) as typeof fetch\r\n });\r\n }\r\n}\r\n","import { HttpLinkFactory } from './httpLinkFactory';\r\nimport { ApolloOrbitFeature } from './types';\r\n\r\nexport function withHttpLink(): ApolloOrbitFeature {\r\n return {\r\n kind: 'APOLLO_ORBIT_HTTP_LINK',\r\n providers: [HttpLinkFactory]\r\n };\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAMa,eAAe,CAAA;AAEP,IAAA,UAAA,CAAA;AADnB,IAAA,WAAA,CACmB,UAAsB,EAAA;QAAtB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;KACpC;IAEE,MAAM,CAAC,UAAuB,EAAE,EAAA;QACrC,OAAO,IAAI,QAAQ,CAAC;AAClB,YAAA,GAAG,OAAO;AACV,YAAA,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAiB;AAClD,SAAA,CAAC,CAAC;KACJ;uGAVU,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;2GAAf,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;;;SCFK,YAAY,GAAA;IAC1B,OAAO;AACL,QAAA,IAAI,EAAE,wBAAwB;QAC9B,SAAS,EAAE,CAAC,eAAe,CAAC;KAC7B,CAAC;AACJ;;ACRA;;AAEG;;;;"}