mirror of
https://github.com/CamHenlin/MessagesForMacintosh.git
synced 2024-12-01 05:51:46 +00:00
2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
exports.__esModule=!0;var e={gql:!0,HttpLink:!0};exports.default=exports.gql=void 0;var r=require("tslib"),t=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}t.default=e,r&&r.set(e,t);return t}(require("apollo-client"));Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||(exports[r]=t[r]))});var n=require("apollo-link");Object.keys(n).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||(exports[r]=n[r]))});var o=require("apollo-cache-inmemory");Object.keys(o).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||(exports[r]=o[r]))});var a=require("apollo-link-http");exports.HttpLink=a.HttpLink;var i,c=require("apollo-link-error"),l=(i=require("graphql-tag"))&&i.__esModule?i:{default:i};exports.gql=l.default;var s=require("ts-invariant");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}var f=["request","uri","credentials","headers","fetch","fetchOptions","clientState","onError","cacheRedirects","cache","name","version","resolvers","typeDefs","fragmentMatcher"],p=function(e){function t(r){void 0===r&&(r={});if(r){var t=Object.keys(r).filter(function(e){return-1===f.indexOf(e)});t.length}var i=r.request,l=r.uri,u=r.credentials,p=r.headers,h=r.fetch,d=r.fetchOptions,v=r.clientState,y=r.cacheRedirects,b=r.onError,O=r.name,g=r.version,k=r.resolvers,m=r.typeDefs,q=r.fragmentMatcher,w=r.cache;(0,s.invariant)(!w||!y,1),w||(w=y?new o.InMemoryCache({cacheRedirects:y}):new o.InMemoryCache);var M=b?(0,c.onError)(b):(0,c.onError)(function(e){var r=e.graphQLErrors;e.networkError;r&&r.forEach(function(e){e.message,e.locations,e.path;return!0})}),_=!!i&&new n.ApolloLink(function(e,r){return new n.Observable(function(t){var n;return Promise.resolve(e).then(function(e){return i(e)}).then(function(){n=r(e).subscribe({next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)})}).catch(t.error.bind(t)),function(){n&&n.unsubscribe()}})}),j=new a.HttpLink({uri:l||"/graphql",fetch:h,fetchOptions:d||{},credentials:u||"same-origin",headers:p||{}}),x=n.ApolloLink.from([M,_,j].filter(function(e){return!!e})),E=k,P=m,D=q;return v&&(v.defaults&&w.writeData({data:v.defaults}),E=v.resolvers,P=v.typeDefs,D=v.fragmentMatcher),e.call(this,{cache:w,link:x,name:O,version:g,resolvers:E,typeDefs:P,fragmentMatcher:D})||this}return(0,r.__extends)(t,e),t}(t.default);exports.default=p;
|