1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("apollo-link"),require("graphql"),require("apollo-angular-link-http-common"),require("extract-files")):"function"==typeof define&&define.amd?define("apollo-angular-link-http",["exports","@angular/core","@angular/common/http","apollo-link","graphql","apollo-angular-link-http-common","extract-files"],t):t((e=e||self).ngApolloLinkHttp={},e.ng.core,e.ng.common.http,e.apolloLink.core,e.graphql,e.ngApolloLinkHttpCommon,e.extractFiles)}(this,(function(e,t,r,n,o,i,u){"use strict";
|
15 | var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};Object.create;Object.create;var p=function(e){function t(t,r){var a=e.call(this)||this;return a.httpClient=t,a.options=r,a.requester=function(e){return new n.Observable((function(t){var r=e.getContext(),n=function(e,t){return i.prioritize(r[e],a.options[e],t)},p=n("includeQuery",!0),l=n("includeExtensions",!1),c=n("method","POST"),s=n("uri","graphql"),f=n("withCredentials"),d=n("useMultipart"),h={method:c,url:"function"==typeof s?s(e):s,body:{operationName:e.operationName,variables:e.variables},options:{withCredentials:f,useMultipart:d,headers:a.options.headers}};l&&(h.body.extensions=e.extensions),p&&(h.body.query=o.print(e.query)),r.headers&&(h.options.headers=i.mergeHeaders(h.options.headers,r.headers));var y=i.fetch(h,a.httpClient,u.extractFiles).subscribe({next:function(r){e.setContext({response:r}),t.next(r.body)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});return function(){y.closed||y.unsubscribe()}}))},a}return function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.request=function(e){return this.requester(e)},t}(n.ApolloLink),l=function(){function e(e){this.httpClient=e}return e.prototype.create=function(e){return new p(this.httpClient,e)},e}();l.decorators=[{type:t.Injectable}],l.ctorParameters=function(){return[{type:r.HttpClient}]};var c=[l],s=function(){};s.decorators=[{type:t.NgModule,args:[{providers:c}]}],e.HttpLink=l,e.HttpLinkHandler=p,e.HttpLinkModule=s,e.PROVIDERS=c,Object.defineProperty(e,"__esModule",{value:!0})}));
|