react-apollo
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -5,3 +5,8 @@ # Change log | ||
### v0.4.5 | ||
- Feature: Allow options value to be an object instead of a method. [#144](https://github.com/apollostack/react-apollo/issues/144) | ||
- Bug: Fixed issue with missing methods on initial props [#142](https://github.com/apollostack/react-apollo/issues/142) | ||
- Bug: Fixed oddity with multi nested enhancers on SSR [#141](https://github.com/apollostack/react-apollo/issues/141) | ||
### v0.4.4 | ||
@@ -8,0 +13,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("react"),i=t("react"),a=t("invariant"),s=function(t){function e(e,r){return t.call(this,e,r),a(e.client,'ApolloClient was not passed a client instance. Make sure you pass in your client via the "client" prop.'),this.client=e.client,e.store?(this.store=e.store,void(e.immutable&&e.client.initStore())):(e.client.initStore(),void(this.store=e.client.store))}return n(e,t),e.prototype.getChildContext=function(){return{store:this.store,client:this.client}},e.prototype.render=function(){return o.Children.only(this.props.children)},e.propTypes={store:i.PropTypes.shape({subscribe:i.PropTypes.func.isRequired,dispatch:i.PropTypes.func.isRequired,getState:i.PropTypes.func.isRequired}),client:i.PropTypes.object.isRequired,immutable:i.PropTypes.bool,children:i.PropTypes.element.isRequired},e.childContextTypes={store:i.PropTypes.object.isRequired,client:i.PropTypes.object.isRequired},e}(i.Component);Object.defineProperty(r,"__esModule",{value:!0}),r.default=s},{invariant:9,react:6}],2:[function(t,e,r){"use strict";function n(t){return t.displayName||t.name||"Component"}function o(t){var e="withApollo("+n(t)+")",r=function(r){function n(t,n){r.call(this,t,n),this.client=t.client||n.client,p(!!this.client,'Could not find "client" in either the context or '+('props of "'+e+'". ')+"Either wrap the root component in an <ApolloProvider>, "+('or explicitly pass "client" as a prop to "'+e+'".'))}return a(n,r),n.prototype.render=function(){var e=f({},this.props);return e.client=this.client,s.createElement(t,e)},n.displayName=e,n.WrappedComponent=t,n.contextTypes={client:s.PropTypes.object.isRequired},n}(s.Component);return h(r,t)}function i(t,e){void 0===e&&(e={});var r=e.options,o=void 0===r?m:r,i=o,j=e.props,O=b.parser(t),P=w++;return function(r){function o(t){(t.fragments||O.fragments.length)&&(t.fragments?t.fragments=c(t.fragments.concat(O.fragments)):t.fragments=c(O.fragments.slice()))}function m(t){var e=i(t);if(e.variables||!O.variables.length)return e.variables;for(var o={},a=0,s=O.variables;a<s.length;a++){var u=s[a].variable;u.name&&u.name.value&&("undefined"==typeof t[u.name.value]?p("undefined"!=typeof t[u.name.value],"The operation '"+O.name+"' wrapping '"+n(r)+"' "+("is expecting a variable: '"+u.name.value+"' but it was not found in the props ")+("passed to '"+q+"'")):o[u.name.value]=t[u.name.value])}return o}function w(e,r){var n=r.client;if(O.type===b.DocumentType.Mutation)return!1;var a=i(e);if(a.query=t,a.ssr===!1)return!1;a.variables||(a.variables=m(e)),a.variables||delete a.variables,o(a);try{return d.readQueryFromStore({store:n.store.getState()[n.reduxRootKey].data,query:a.query,variables:a.variables,fragmentMap:y.createFragmentMap(a.fragments)}),!1}catch(t){}return n.query(a)}var q="Apollo("+n(r)+")",T=function(n){function c(t,e){n.call(this,t,e),this.data={},this.version=P,this.client=t.client||e.client,this.store=this.client.store,p(!!this.client,'Could not find "client" in either the context or '+('props of "'+q+'". ')+"Either wrap the root component in an <ApolloProvider>, "+('or explicitly pass "client" as a prop to "'+q+'".')),this.type=O.type,this.queryObservable={},this.querySubscription={},this.setInitialProps()}return a(c,n),c.prototype.componentDidMount=function(){this.hasMounted=!0,this.type!==b.DocumentType.Mutation&&this.subscribeToQuery(this.props)},c.prototype.componentWillReceiveProps=function(t){if(!l.default(this.props,t)){if(this.type===b.DocumentType.Mutation)return void this.createWrappedMutation(t,!0);this.haveOwnPropsChanged=!0,this.subscribeToQuery(t)}},c.prototype.shouldComponentUpdate=function(t,e){return this.haveOwnPropsChanged||this.hasOperationDataChanged},c.prototype.componentWillUnmount=function(){this.type===b.DocumentType.Query&&this.unsubscribeFromQuery(),this.hasMounted=!1},c.prototype.calculateVariables=function(t){return m(t)},c.prototype.calculateResultProps=function(t){var r=this.type===b.DocumentType.Query?"data":"mutate";e.name&&(r=e.name);var n=(o={},o[r]=t,o.ownProps=this.props,o);return j?j(n):(i={},i[r]=_(t),i);var o,i},c.prototype.setInitialProps=function(){if(this.type===b.DocumentType.Mutation)return void this.createWrappedMutation(this.props);var e=this.client.reduxRootKey,r=this.calculateVariables(this.props),n=g;n.variables=r;try{var o=d.readQueryFromStore({store:this.store.getState()[e].data,query:t,variables:r});n=f({errors:null,loading:!1,variables:r},o)}catch(t){}this.data=n},c.prototype.subscribeToQuery=function(e){var r=this.client.watchQuery,n=i(e);if(!n.skip){if(n.variables=this.calculateVariables(e),u(n,this.previousOpts))return!1;var a=f({},this.previousOpts),s=f({},n);if(delete a.variables,delete s.variables,this.previousOpts&&!l.default(n.variables,this.previousOpts.variables)&&l.default(a,s))return this.hasOperationDataChanged=!0,this.data=f(this.data,{loading:!0,variables:n.variables}),this.forceRenderChildren(),this.queryObservable.refetch(f({},this.previousOpts.variables,n.variables)),void(this.previousOpts=n);this.previousOpts=n;var c=this.queryObservable;this.unsubscribeFromQuery();var p=f({query:t},n);o(p);var h=r(p),d=h.queryId;c.queryId&&c.queryId!==d&&(this.data=f(this.data,{loading:!0}),this.hasOperationDataChanged=!0,this.forceRenderChildren()),this.handleQueryData(h,p)}},c.prototype.unsubscribeFromQuery=function(){this.querySubscription.unsubscribe&&(this.querySubscription.unsubscribe(),delete this.queryObservable)},c.prototype.handleQueryData=function(t,e){var r,n,o,i,a=this,s=e.variables,c=this.client.reduxRootKey,l={},h=function(e){var s=e.data,h=void 0===s?l:s,d=e.loading,y=e.error,v=t.queryId,b=a.store.getState()[c].queries[v].variables,g="errors"in h||"loading"in h||"refetch"in h||"fetchMore"in h||"startPolling"in h||"stopPolling"in h;p(!g,"the result of the '"+q+"' operation contains keys that conflict with the return object. 'errors', 'loading', 'startPolling', 'stopPolling', 'fetchMore', and 'refetch' cannot be returned keys"),u(l,h)&&d===a.data.loading||(a.hasOperationDataChanged=!0),l=f({},h),a.data=f({variables:b,loading:d,refetch:r,startPolling:o,stopPolling:i,fetchMore:n,error:y},h),a.forceRenderChildren()},d=function(t){return function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=e,i={loading:!0};return e&&(e.variables||e.query||e.updateQuery)&&(o=f({},a.data.variables,e.variables),i.variables=o),a.data=f(a.data,i),a.hasOperationDataChanged=!0,a.forceRenderChildren(),t.apply(void 0,[e].concat(r)).then(function(t){return t&&u(t.data,l)&&h(t),t})}};this.queryObservable=t;var y=function(t){if(t instanceof v.ApolloError)return h({error:t});throw t};this.querySubscription=t.subscribe({next:h,error:y}),r=d(this.queryObservable.refetch),n=d(this.queryObservable.fetchMore),o=this.queryObservable.startPolling,i=this.queryObservable.stopPolling,delete this.data.error,this.data=f(this.data,{refetch:r,startPolling:o,stopPolling:i,fetchMore:n,variables:s})},c.prototype.forceRenderChildren=function(){this.hasMounted&&this.setState({})},c.prototype.getWrappedInstance=function(){return p(e.withRef,"To access the wrapped instance, you need to specify { withRef: true } in the options"),this.refs.wrappedInstance},c.prototype.createWrappedMutation=function(e,r){var n=this;void 0===r&&(r=!1),this.type===b.DocumentType.Mutation&&(this.data=function(r){var a=i(e);return a.variables&&(a.variables=f({},a.variables,r.variables)),r=f({},a,r),a.variables||r.variables||(r.variables=n.calculateVariables(e)),"undefined"==typeof r.variables&&delete r.variables,r.mutation=t,o(r),n.client.mutate(r)},r&&(this.hasOperationDataChanged=!0,this.forceRenderChildren()))},c.prototype.render=function(){var t=this,n=t.haveOwnPropsChanged,o=t.hasOperationDataChanged,i=t.renderedElement,a=t.props,u=t.data;this.haveOwnPropsChanged=!1,this.hasOperationDataChanged=!1;var c=this.calculateResultProps(u),l=f({},a,c);return n||o||!i?(e.withRef&&(l.ref="wrappedInstance"),this.renderedElement=s.createElement(r,l),this.renderedElement):i},c.displayName=q,c.WrappedComponent=r,c.contextTypes={store:s.PropTypes.object.isRequired,client:s.PropTypes.object.isRequired},c.fetchData=O.type===b.DocumentType.Query&&w,c.fragments=O.fragments,c}(s.Component);return h(T,r)}}var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},s=t("react"),u=t("lodash.isequal"),c=t("lodash.flatten"),l=t("./shallowEqual"),p=t("invariant"),f=t("object-assign"),h=t("hoist-non-react-statics"),d=t("apollo-client"),y=t("apollo-client/queries/getFromAST"),v=t("apollo-client/errors"),b=t("./parser"),g={loading:!0,errors:null},m=function(t){return{}},_=function(t){return t},w=0;r.withApollo=o,Object.defineProperty(r,"__esModule",{value:!0}),r.default=i},{"./parser":4,"./shallowEqual":5,"apollo-client":6,"apollo-client/errors":6,"apollo-client/queries/getFromAST":6,"hoist-non-react-statics":8,invariant:9,"lodash.flatten":10,"lodash.isequal":11,"object-assign":12,react:6}],3:[function(t,e,r){"use strict";var n=t("./ApolloProvider");r.ApolloProvider=n.default;var o=t("./graphql");r.graphql=o.default,r.withApollo=o.withApollo},{"./ApolloProvider":1,"./graphql":2}],4:[function(t,e,r){"use strict";function n(t){var e,r,n,s,u,c,l;i(!!t||!!t.kind,"Argument of "+t+" passed to parser was not a valid GraphQL Document. You may need to use 'graphql-tag' or another method to convert your operation into a document"),e=t.definitions.filter(function(t){return"FragmentDefinition"===t.kind}),e=o.createFragment({kind:"Document",definitions:e.slice()}),r=t.definitions.filter(function(t){return"OperationDefinition"===t.kind&&"query"===t.operation}),n=t.definitions.filter(function(t){return"OperationDefinition"===t.kind&&"mutation"===t.operation}),!e.length||r.length&&n.length||i(!0,"Passing only a fragment to 'graphql' is not yet supported. You must include a query or mutation as well"),r.length&&n.length&&i(r.length&&n.length,"react-apollo only supports a query or a mutation per HOC. "+t+" had "+r.length+" queries and "+n.length+" muations. You can use 'combineOperations' to join multiple operation types to a component"),c=r.length?a.Query:a.Mutation,u=r.length?r:n,1!==u.length&&i(1!==u.length,"react-apollo only supports one defintion per HOC. "+t+" had "+u.length+" definitions. You can use 'combineOperations' to join multiple operation types to a component"),s=u[0].variableDefinitions||[];var p=u[0].name&&"Name"===u[0].name.kind;return l=p?u[0].name.value:"data",e=e.length?e:[],{name:l,type:c,variables:s,fragments:e}}var o=t("apollo-client"),i=t("invariant");!function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation"}(r.DocumentType||(r.DocumentType={}));var a=r.DocumentType;r.parser=n},{"apollo-client":6,invariant:9}],5:[function(t,e,r){"use strict";function n(t,e){if(!t||!e)return!0;if(t===e)return!0;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<r.length;i++)if(!o.call(e,r[i])||t[r[i]]!==e[r[i]])return!1;return!0}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},{}],6:[function(t,e,r){},{}],7:[function(t,e,r){function n(t){if(c===setTimeout)return setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function i(){d&&f&&(d=!1,f.length?h=f.concat(h):y=-1,h.length&&a())}function a(){if(!d){var t=n(i);d=!0;for(var e=h.length;e;){for(f=h,h=[];++y<e;)f&&f[y].run();y=-1,e=h.length}f=null,d=!1,o(t)}}function s(t,e){this.fun=t,this.array=e}function u(){}var c,l,p=e.exports={};!function(){try{c=setTimeout}catch(t){c=function(){throw new Error("setTimeout is not defined")}}try{l=clearTimeout}catch(t){l=function(){throw new Error("clearTimeout is not defined")}}}();var f,h=[],d=!1,y=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new s(t,e)),1!==h.length||d||n(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],8:[function(t,e,r){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},i="function"==typeof Object.getOwnPropertySymbols;e.exports=function(t,e,r){if("string"!=typeof e){var a=Object.getOwnPropertyNames(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e)));for(var s=0;s<a.length;++s)if(!(n[a[s]]||o[a[s]]||r&&r[a[s]]))try{t[a[s]]=e[a[s]]}catch(t){}}return t}},{}],9:[function(t,e,r){(function(t){"use strict";var r=function(e,r,n,o,i,a,s,u){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===r)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,u],p=0;c=new Error(r.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};e.exports=r}).call(this,t("_process"))},{_process:7}],10:[function(t,e,r){(function(t){function r(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function n(t,e,i,a,s){var u=-1,c=t.length;for(i||(i=o),s||(s=[]);++u<c;){var l=t[u];e>0&&i(l)?e>1?n(l,e-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}function o(t){return T(t)||a(t)||!!(q&&t&&t[q])}function i(t){var e=t?t.length:0;return e?n(t,1):[]}function a(t){return u(t)&&w.call(t,"callee")&&(!P.call(t,"callee")||j.call(t)==d)}function s(t){return null!=t&&l(t.length)&&!c(t)}function u(t){return f(t)&&s(t)}function c(t){var e=p(t)?j.call(t):"";return e==y||e==v}function l(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function f(t){return!!t&&"object"==typeof t}var h=9007199254740991,d="[object Arguments]",y="[object Function]",v="[object GeneratorFunction]",b="object"==typeof t&&t&&t.Object===Object&&t,g="object"==typeof self&&self&&self.Object===Object&&self,m=b||g||Function("return this")(),_=Object.prototype,w=_.hasOwnProperty,j=_.toString,O=m.Symbol,P=_.propertyIsEnumerable,q=O?O.isConcatSpreadable:void 0,T=Array.isArray;e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,r){(function(t){function n(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function o(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function i(t){return function(e){return t(e)}}function a(t,e){return null==t?void 0:t[e]}function s(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function u(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function c(t,e){return function(r){return t(e(r))}}function l(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function p(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function f(){this.__data__=je?je(null):{}}function h(t){return this.has(t)&&delete this.__data__[t]}function d(t){var e=this.__data__;if(je){var r=e[t];return r===ht?void 0:r}return ce.call(e,t)?e[t]:void 0}function y(t){var e=this.__data__;return je?void 0!==e[t]:ce.call(e,t)}function v(t,e){var r=this.__data__;return r[t]=je&&void 0===e?ht:e,this}function b(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function g(){this.__data__=[]}function m(t){var e=this.__data__,r=N(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ye.call(e,r,1),!0}function _(t){var e=this.__data__,r=N(e,t);return r<0?void 0:e[r][1]}function w(t){return N(this.__data__,t)>-1}function j(t,e){var r=this.__data__,n=N(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function P(){this.__data__={hash:new p,map:new(ge||b),string:new p}}function q(t){return K(this,t).delete(t)}function T(t){return K(this,t).get(t)}function A(t){return K(this,t).has(t)}function C(t,e){return K(this,t).set(t,e),this}function D(t){var e=-1,r=t?t.length:0;for(this.__data__=new O;++e<r;)this.add(t[e])}function x(t){return this.__data__.set(t,ht),this}function S(t){return this.__data__.has(t)}function E(t){this.__data__=new b(t)}function M(){this.__data__=new b}function R(t){return this.__data__.delete(t)}function k(t){return this.__data__.get(t)}function F(t){return this.__data__.has(t)}function Q(t,e){var r=this.__data__;if(r instanceof b){var n=r.__data__;if(!ge||n.length<ft-1)return n.push([t,e]),this;r=this.__data__=new O(n)}return r.set(t,e),this}function I(t,e){var r=Se(t)||nt(t)?o(t.length,String):[],n=r.length,i=!!n;for(var a in t)!e&&!ce.call(t,a)||i&&("length"==a||J(a,n))||r.push(a);return r}function N(t,e){for(var r=t.length;r--;)if(rt(t[r][0],e))return r;return-1}function W(t){return le.call(t)}function L(t,e,r,n,o){return t===e||(null==t||null==e||!ct(t)&&!lt(e)?t!==t&&e!==e:U(t,e,L,r,n,o))}function U(t,e,r,n,o,i){var a=Se(t),u=Se(e),c=gt,l=gt;a||(c=xe(t),c=c==bt?Tt:c),u||(l=xe(e),l=l==bt?Tt:l);var p=c==Tt&&!s(t),f=l==Tt&&!s(e),h=c==l;if(h&&!p)return i||(i=new E),a||Ee(t)?Y(t,e,r,n,o,i):B(t,e,c,r,n,o,i);if(!(o&yt)){var d=p&&ce.call(t,"__wrapped__"),y=f&&ce.call(e,"__wrapped__");if(d||y){var v=d?t.value():t,b=y?e.value():e;return i||(i=new E),r(v,b,n,o,i)}}return!!h&&(i||(i=new E),G(t,e,r,n,o,i))}function V(t){if(!ct(t)||Z(t))return!1;var e=st(t)||s(t)?pe:zt;return e.test(et(t))}function $(t){return lt(t)&&ut(t.length)&&!!Bt[le.call(t)]}function z(t){if(!tt(t))return ve(t);var e=[];for(var r in Object(t))ce.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Y(t,e,r,o,i,a){var s=i&yt,u=t.length,c=e.length;if(u!=c&&!(s&&c>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var p=-1,f=!0,h=i&dt?new D:void 0;for(a.set(t,e),a.set(e,t);++p<u;){var d=t[p],y=e[p];if(o)var v=s?o(y,d,p,e,t,a):o(d,y,p,t,e,a);if(void 0!==v){if(v)continue;f=!1;break}if(h){if(!n(e,function(t,e){if(!h.has(e)&&(d===t||r(d,t,o,i,a)))return h.add(e)})){f=!1;break}}else if(d!==y&&!r(d,y,o,i,a)){f=!1;break}}return a.delete(t),a.delete(e),f}function B(t,e,r,n,o,i,a){switch(r){case Rt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Mt:return!(t.byteLength!=e.byteLength||!n(new he(t),new he(e)));case mt:case _t:case qt:return rt(+t,+e);case wt:return t.name==e.name&&t.message==e.message;case Ct:case xt:return t==e+"";case Pt:var s=u;case Dt:var c=i&yt;if(s||(s=l),t.size!=e.size&&!c)return!1;var p=a.get(t);if(p)return p==e;i|=dt,a.set(t,e);var f=Y(s(t),s(e),n,o,i,a);return a.delete(t),f;case St:if(De)return De.call(t)==De.call(e)}return!1}function G(t,e,r,n,o,i){var a=o&yt,s=pt(t),u=s.length,c=pt(e),l=c.length;if(u!=l&&!a)return!1;for(var p=u;p--;){var f=s[p];if(!(a?f in e:ce.call(e,f)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var d=!0;i.set(t,e),i.set(e,t);for(var y=a;++p<u;){f=s[p];var v=t[f],b=e[f];if(n)var g=a?n(b,v,f,e,t,i):n(v,b,f,t,e,i);if(!(void 0===g?v===b||r(v,b,n,o,i):g)){d=!1;break}y||(y="constructor"==f)}if(d&&!y){var m=t.constructor,_=e.constructor;m!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return i.delete(t),i.delete(e),d}function K(t,e){var r=t.__data__;return X(e)?r["string"==typeof e?"string":"hash"]:r.map}function H(t,e){var r=a(t,e);return V(r)?r:void 0}function J(t,e){return e=null==e?vt:e,!!e&&("number"==typeof t||Yt.test(t))&&t>-1&&t%1==0&&t<e}function X(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Z(t){return!!se&&se in t}function tt(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||ie;return t===r}function et(t){if(null!=t){try{return ue.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function rt(t,e){return t===e||t!==t&&e!==e}function nt(t){return it(t)&&ce.call(t,"callee")&&(!de.call(t,"callee")||le.call(t)==bt)}function ot(t){return null!=t&&ut(t.length)&&!st(t)}function it(t){return lt(t)&&ot(t)}function at(t,e){return L(t,e)}function st(t){var e=ct(t)?le.call(t):"";return e==jt||e==Ot}function ut(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=vt}function ct(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function lt(t){return!!t&&"object"==typeof t}function pt(t){return ot(t)?I(t):z(t)}var ft=200,ht="__lodash_hash_undefined__",dt=1,yt=2,vt=9007199254740991,bt="[object Arguments]",gt="[object Array]",mt="[object Boolean]",_t="[object Date]",wt="[object Error]",jt="[object Function]",Ot="[object GeneratorFunction]",Pt="[object Map]",qt="[object Number]",Tt="[object Object]",At="[object Promise]",Ct="[object RegExp]",Dt="[object Set]",xt="[object String]",St="[object Symbol]",Et="[object WeakMap]",Mt="[object ArrayBuffer]",Rt="[object DataView]",kt="[object Float32Array]",Ft="[object Float64Array]",Qt="[object Int8Array]",It="[object Int16Array]",Nt="[object Int32Array]",Wt="[object Uint8Array]",Lt="[object Uint8ClampedArray]",Ut="[object Uint16Array]",Vt="[object Uint32Array]",$t=/[\\^$.*+?()[\]{}|]/g,zt=/^\[object .+?Constructor\]$/,Yt=/^(?:0|[1-9]\d*)$/,Bt={};Bt[kt]=Bt[Ft]=Bt[Qt]=Bt[It]=Bt[Nt]=Bt[Wt]=Bt[Lt]=Bt[Ut]=Bt[Vt]=!0,Bt[bt]=Bt[gt]=Bt[Mt]=Bt[mt]=Bt[Rt]=Bt[_t]=Bt[wt]=Bt[jt]=Bt[Pt]=Bt[qt]=Bt[Tt]=Bt[Ct]=Bt[Dt]=Bt[xt]=Bt[Et]=!1;var Gt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,Ht=Gt||Kt||Function("return this")(),Jt="object"==typeof r&&r&&!r.nodeType&&r,Xt=Jt&&"object"==typeof e&&e&&!e.nodeType&&e,Zt=Xt&&Xt.exports===Jt,te=Zt&&Gt.process,ee=function(){try{return te&&te.binding("util")}catch(t){}}(),re=ee&&ee.isTypedArray,ne=Array.prototype,oe=Function.prototype,ie=Object.prototype,ae=Ht["__core-js_shared__"],se=function(){var t=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ue=oe.toString,ce=ie.hasOwnProperty,le=ie.toString,pe=RegExp("^"+ue.call(ce).replace($t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fe=Ht.Symbol,he=Ht.Uint8Array,de=ie.propertyIsEnumerable,ye=ne.splice,ve=c(Object.keys,Object),be=H(Ht,"DataView"),ge=H(Ht,"Map"),me=H(Ht,"Promise"),_e=H(Ht,"Set"),we=H(Ht,"WeakMap"),je=H(Object,"create"),Oe=et(be),Pe=et(ge),qe=et(me),Te=et(_e),Ae=et(we),Ce=fe?fe.prototype:void 0,De=Ce?Ce.valueOf:void 0;p.prototype.clear=f,p.prototype.delete=h,p.prototype.get=d,p.prototype.has=y,p.prototype.set=v,b.prototype.clear=g,b.prototype.delete=m,b.prototype.get=_,b.prototype.has=w,b.prototype.set=j,O.prototype.clear=P,O.prototype.delete=q,O.prototype.get=T,O.prototype.has=A,O.prototype.set=C,D.prototype.add=D.prototype.push=x,D.prototype.has=S,E.prototype.clear=M,E.prototype.delete=R,E.prototype.get=k,E.prototype.has=F,E.prototype.set=Q;var xe=W;(be&&xe(new be(new ArrayBuffer(1)))!=Rt||ge&&xe(new ge)!=Pt||me&&xe(me.resolve())!=At||_e&&xe(new _e)!=Dt||we&&xe(new we)!=Et)&&(xe=function(t){var e=le.call(t),r=e==Tt?t.constructor:void 0,n=r?et(r):void 0;if(n)switch(n){case Oe:return Rt;case Pe:return Pt;case qe:return At;case Te:return Dt;case Ae:return Et}return e});var Se=Array.isArray,Ee=re?i(re):$;e.exports=at}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function o(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(t,e){for(var r,o,s=n(t),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var c in r)i.call(r,c)&&(s[c]=r[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(r);for(var l=0;l<o.length;l++)a.call(r,o[l])&&(s[o[l]]=r[o[l]])}}return s}},{}]},{},[3]); | ||
!function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("react"),i=t("react"),a=t("invariant"),s=function(t){function e(e,r){return t.call(this,e,r),a(e.client,'ApolloClient was not passed a client instance. Make sure you pass in your client via the "client" prop.'),this.client=e.client,e.store?(this.store=e.store,void(e.immutable&&e.client.initStore())):(e.client.initStore(),void(this.store=e.client.store))}return n(e,t),e.prototype.getChildContext=function(){return{store:this.store,client:this.client}},e.prototype.render=function(){return o.Children.only(this.props.children)},e.propTypes={store:i.PropTypes.shape({subscribe:i.PropTypes.func.isRequired,dispatch:i.PropTypes.func.isRequired,getState:i.PropTypes.func.isRequired}),client:i.PropTypes.object.isRequired,immutable:i.PropTypes.bool,children:i.PropTypes.element.isRequired},e.childContextTypes={store:i.PropTypes.object.isRequired,client:i.PropTypes.object.isRequired},e}(i.Component);Object.defineProperty(r,"__esModule",{value:!0}),r.default=s},{invariant:9,react:6}],2:[function(t,e,r){"use strict";function n(t){return t.displayName||t.name||"Component"}function o(t){var e="withApollo("+n(t)+")",r=function(r){function n(t,n){r.call(this,t,n),this.client=t.client||n.client,p(!!this.client,'Could not find "client" in either the context or '+('props of "'+e+'". ')+"Either wrap the root component in an <ApolloProvider>, "+('or explicitly pass "client" as a prop to "'+e+'".'))}return a(n,r),n.prototype.render=function(){var e=f({},this.props);return e.client=this.client,s.createElement(t,e)},n.displayName=e,n.WrappedComponent=t,n.contextTypes={client:s.PropTypes.object.isRequired},n}(s.Component);return h(r,t)}function i(t,e){void 0===e&&(e={});var r=e.options,o=void 0===r?m:r,i=o;"function"!=typeof i&&(i=function(){return o});var j=e.props,O=b.parser(t),q=w++;return function(r){function o(t){(t.fragments||O.fragments.length)&&(t.fragments?t.fragments=c(t.fragments.concat(O.fragments)):t.fragments=c(O.fragments.slice()))}function m(t){var e=i(t);if(e.variables||!O.variables.length)return e.variables;for(var o={},a=0,s=O.variables;a<s.length;a++){var u=s[a].variable;u.name&&u.name.value&&("undefined"==typeof t[u.name.value]?p("undefined"!=typeof t[u.name.value],"The operation '"+O.name+"' wrapping '"+n(r)+"' "+("is expecting a variable: '"+u.name.value+"' but it was not found in the props ")+("passed to '"+P+"'")):o[u.name.value]=t[u.name.value])}return o}function w(e,r){var n=r.client;if(O.type===b.DocumentType.Mutation)return!1;var a=i(e);if(a.query=t,a.ssr===!1)return!1;a.variables||(a.variables=m(e)),a.variables||delete a.variables,o(a);try{return d.readQueryFromStore({store:n.store.getState()[n.reduxRootKey].data,query:a.query,variables:a.variables,fragmentMap:y.createFragmentMap(a.fragments)}),!1}catch(t){}return n.query(a)}var P="Apollo("+n(r)+")",T=function(n){function c(t,e){n.call(this,t,e),this.data={},this.version=q,this.client=t.client||e.client,this.store=this.client.store,p(!!this.client,'Could not find "client" in either the context or '+('props of "'+P+'". ')+"Either wrap the root component in an <ApolloProvider>, "+('or explicitly pass "client" as a prop to "'+P+'".')),this.type=O.type,this.queryObservable={},this.querySubscription={},this.setInitialProps()}return a(c,n),c.prototype.componentDidMount=function(){this.hasMounted=!0,this.type!==b.DocumentType.Mutation&&this.subscribeToQuery(this.props)},c.prototype.componentWillReceiveProps=function(t){if(!l.default(this.props,t)){if(this.type===b.DocumentType.Mutation)return void this.createWrappedMutation(t,!0);this.haveOwnPropsChanged=!0,this.subscribeToQuery(t)}},c.prototype.shouldComponentUpdate=function(t,e){return this.haveOwnPropsChanged||this.hasOperationDataChanged},c.prototype.componentWillUnmount=function(){this.type===b.DocumentType.Query&&this.unsubscribeFromQuery(),this.hasMounted=!1},c.prototype.calculateVariables=function(t){return m(t)},c.prototype.calculateResultProps=function(t){var r=this.type===b.DocumentType.Query?"data":"mutate";e.name&&(r=e.name);var n=(o={},o[r]=t,o.ownProps=this.props,o);return j?j(n):(i={},i[r]=_(t),i);var o,i},c.prototype.setInitialProps=function(){var e=this;if(this.type===b.DocumentType.Mutation)return void this.createWrappedMutation(this.props);var r=this.client.reduxRootKey,n=this.calculateVariables(this.props),o=g;o.variables=n;try{var i=d.readQueryFromStore({store:this.store.getState()[r].data,query:t,variables:n}),a=function(r){return e.client.query({query:t,variables:r})},s=function(r){return r.query=t,e.client.query(r)};o=f({errors:null,loading:!1,variables:n,refetch:a,fetchMore:s},i)}catch(t){}this.data=o},c.prototype.subscribeToQuery=function(e){var r=this.client.watchQuery,n=i(e);if(!n.skip){if(n.variables=this.calculateVariables(e),u(n,this.previousOpts))return!1;var a=f({},this.previousOpts),s=f({},n);if(delete a.variables,delete s.variables,this.previousOpts&&!l.default(n.variables,this.previousOpts.variables)&&l.default(a,s))return this.hasOperationDataChanged=!0,this.data=f(this.data,{loading:!0,variables:n.variables}),this.forceRenderChildren(),this.queryObservable.refetch(f({},this.previousOpts.variables,n.variables)),void(this.previousOpts=n);this.previousOpts=n;var c=this.queryObservable;this.unsubscribeFromQuery();var p=f({query:t},n);o(p);var h=r(p),d=h.queryId;c.queryId&&c.queryId!==d&&(this.data=f(this.data,{loading:!0}),this.hasOperationDataChanged=!0,this.forceRenderChildren()),this.handleQueryData(h,p)}},c.prototype.unsubscribeFromQuery=function(){this.querySubscription.unsubscribe&&(this.querySubscription.unsubscribe(),delete this.queryObservable)},c.prototype.handleQueryData=function(t,e){var r,n,o,i,a=this,s=e.variables,c=this.client.reduxRootKey,l={},h=function(e){var s=e.data,h=void 0===s?l:s,d=e.loading,y=e.error,v=t.queryId,b=a.store.getState()[c].queries[v].variables,g="errors"in h||"loading"in h||"refetch"in h||"fetchMore"in h||"startPolling"in h||"stopPolling"in h;p(!g,"the result of the '"+P+"' operation contains keys that conflict with the return object. 'errors', 'loading', 'startPolling', 'stopPolling', 'fetchMore', and 'refetch' cannot be returned keys"),u(l,h)&&d===a.data.loading||(a.hasOperationDataChanged=!0),l=f({},h),a.data=f({variables:b,loading:d,refetch:r,startPolling:o,stopPolling:i,fetchMore:n,error:y},h),a.forceRenderChildren()},d=function(t){return function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=e,i={loading:!0};return e&&(e.variables||e.query||e.updateQuery)&&(o=f({},a.data.variables,e.variables),i.variables=o),a.data=f(a.data,i),a.hasOperationDataChanged=!0,a.forceRenderChildren(),t.apply(void 0,[e].concat(r)).then(function(t){return t&&u(t.data,l)&&h(t),t})}};this.queryObservable=t;var y=function(t){if(t instanceof v.ApolloError)return h({error:t});throw t};this.querySubscription=t.subscribe({next:h,error:y}),r=d(this.queryObservable.refetch),n=d(this.queryObservable.fetchMore),o=this.queryObservable.startPolling,i=this.queryObservable.stopPolling,delete this.data.error,this.data=f(this.data,{refetch:r,startPolling:o,stopPolling:i,fetchMore:n,variables:s})},c.prototype.forceRenderChildren=function(){this.hasMounted&&this.setState({})},c.prototype.getWrappedInstance=function(){return p(e.withRef,"To access the wrapped instance, you need to specify { withRef: true } in the options"),this.refs.wrappedInstance},c.prototype.createWrappedMutation=function(e,r){var n=this;void 0===r&&(r=!1),this.type===b.DocumentType.Mutation&&(this.data=function(r){var a=i(e);return a.variables&&(a.variables=f({},a.variables,r.variables)),r=f({},a,r),a.variables||r.variables||(r.variables=n.calculateVariables(e)),"undefined"==typeof r.variables&&delete r.variables,r.mutation=t,o(r),n.client.mutate(r)},r&&(this.hasOperationDataChanged=!0,this.forceRenderChildren()))},c.prototype.render=function(){var t=this,n=t.haveOwnPropsChanged,o=t.hasOperationDataChanged,i=t.renderedElement,a=t.props,u=t.data;this.haveOwnPropsChanged=!1,this.hasOperationDataChanged=!1;var c=this.calculateResultProps(u),l=f({},a,c);return n||o||!i?(e.withRef&&(l.ref="wrappedInstance"),this.renderedElement=s.createElement(r,l),this.renderedElement):i},c.displayName=P,c.WrappedComponent=r,c.contextTypes={store:s.PropTypes.object.isRequired,client:s.PropTypes.object.isRequired},c.fragments=O.fragments,c}(s.Component);return O.type===b.DocumentType.Query&&(T.fetchData=w),h(T,r)}}var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},s=t("react"),u=t("lodash.isequal"),c=t("lodash.flatten"),l=t("./shallowEqual"),p=t("invariant"),f=t("object-assign"),h=t("hoist-non-react-statics"),d=t("apollo-client"),y=t("apollo-client/queries/getFromAST"),v=t("apollo-client/errors"),b=t("./parser"),g={loading:!0,errors:null},m=function(t){return{}},_=function(t){return t},w=0;r.withApollo=o,Object.defineProperty(r,"__esModule",{value:!0}),r.default=i},{"./parser":4,"./shallowEqual":5,"apollo-client":6,"apollo-client/errors":6,"apollo-client/queries/getFromAST":6,"hoist-non-react-statics":8,invariant:9,"lodash.flatten":10,"lodash.isequal":11,"object-assign":12,react:6}],3:[function(t,e,r){"use strict";var n=t("./ApolloProvider");r.ApolloProvider=n.default;var o=t("./graphql");r.graphql=o.default,r.withApollo=o.withApollo},{"./ApolloProvider":1,"./graphql":2}],4:[function(t,e,r){"use strict";function n(t){var e,r,n,s,u,c,l;i(!!t||!!t.kind,"Argument of "+t+" passed to parser was not a valid GraphQL Document. You may need to use 'graphql-tag' or another method to convert your operation into a document"),e=t.definitions.filter(function(t){return"FragmentDefinition"===t.kind}),e=o.createFragment({kind:"Document",definitions:e.slice()}),r=t.definitions.filter(function(t){return"OperationDefinition"===t.kind&&"query"===t.operation}),n=t.definitions.filter(function(t){return"OperationDefinition"===t.kind&&"mutation"===t.operation}),!e.length||r.length&&n.length||i(!0,"Passing only a fragment to 'graphql' is not yet supported. You must include a query or mutation as well"),r.length&&n.length&&i(r.length&&n.length,"react-apollo only supports a query or a mutation per HOC. "+t+" had "+r.length+" queries and "+n.length+" muations. You can use 'combineOperations' to join multiple operation types to a component"),c=r.length?a.Query:a.Mutation,u=r.length?r:n,1!==u.length&&i(1!==u.length,"react-apollo only supports one defintion per HOC. "+t+" had "+u.length+" definitions. You can use 'combineOperations' to join multiple operation types to a component"),s=u[0].variableDefinitions||[];var p=u[0].name&&"Name"===u[0].name.kind;return l=p?u[0].name.value:"data",e=e.length?e:[],{name:l,type:c,variables:s,fragments:e}}var o=t("apollo-client"),i=t("invariant");!function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation"}(r.DocumentType||(r.DocumentType={}));var a=r.DocumentType;r.parser=n},{"apollo-client":6,invariant:9}],5:[function(t,e,r){"use strict";function n(t,e){if(!t||!e)return!0;if(t===e)return!0;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<r.length;i++)if(!o.call(e,r[i])||t[r[i]]!==e[r[i]])return!1;return!0}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n},{}],6:[function(t,e,r){},{}],7:[function(t,e,r){function n(t){if(c===setTimeout)return setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function i(){d&&f&&(d=!1,f.length?h=f.concat(h):y=-1,h.length&&a())}function a(){if(!d){var t=n(i);d=!0;for(var e=h.length;e;){for(f=h,h=[];++y<e;)f&&f[y].run();y=-1,e=h.length}f=null,d=!1,o(t)}}function s(t,e){this.fun=t,this.array=e}function u(){}var c,l,p=e.exports={};!function(){try{c=setTimeout}catch(t){c=function(){throw new Error("setTimeout is not defined")}}try{l=clearTimeout}catch(t){l=function(){throw new Error("clearTimeout is not defined")}}}();var f,h=[],d=!1,y=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new s(t,e)),1!==h.length||d||n(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],8:[function(t,e,r){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},i="function"==typeof Object.getOwnPropertySymbols;e.exports=function(t,e,r){if("string"!=typeof e){var a=Object.getOwnPropertyNames(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e)));for(var s=0;s<a.length;++s)if(!(n[a[s]]||o[a[s]]||r&&r[a[s]]))try{t[a[s]]=e[a[s]]}catch(t){}}return t}},{}],9:[function(t,e,r){(function(t){"use strict";var r=function(e,r,n,o,i,a,s,u){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===r)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,u],p=0;c=new Error(r.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};e.exports=r}).call(this,t("_process"))},{_process:7}],10:[function(t,e,r){(function(t){function r(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function n(t,e,i,a,s){var u=-1,c=t.length;for(i||(i=o),s||(s=[]);++u<c;){var l=t[u];e>0&&i(l)?e>1?n(l,e-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}function o(t){return T(t)||a(t)||!!(P&&t&&t[P])}function i(t){var e=t?t.length:0;return e?n(t,1):[]}function a(t){return u(t)&&w.call(t,"callee")&&(!q.call(t,"callee")||j.call(t)==d)}function s(t){return null!=t&&l(t.length)&&!c(t)}function u(t){return f(t)&&s(t)}function c(t){var e=p(t)?j.call(t):"";return e==y||e==v}function l(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function f(t){return!!t&&"object"==typeof t}var h=9007199254740991,d="[object Arguments]",y="[object Function]",v="[object GeneratorFunction]",b="object"==typeof t&&t&&t.Object===Object&&t,g="object"==typeof self&&self&&self.Object===Object&&self,m=b||g||Function("return this")(),_=Object.prototype,w=_.hasOwnProperty,j=_.toString,O=m.Symbol,q=_.propertyIsEnumerable,P=O?O.isConcatSpreadable:void 0,T=Array.isArray;e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,r){(function(t){function n(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function o(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function i(t){return function(e){return t(e)}}function a(t,e){return null==t?void 0:t[e]}function s(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function u(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function c(t,e){return function(r){return t(e(r))}}function l(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function p(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function f(){this.__data__=je?je(null):{}}function h(t){return this.has(t)&&delete this.__data__[t]}function d(t){var e=this.__data__;if(je){var r=e[t];return r===ht?void 0:r}return ce.call(e,t)?e[t]:void 0}function y(t){var e=this.__data__;return je?void 0!==e[t]:ce.call(e,t)}function v(t,e){var r=this.__data__;return r[t]=je&&void 0===e?ht:e,this}function b(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function g(){this.__data__=[]}function m(t){var e=this.__data__,r=N(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ye.call(e,r,1),!0}function _(t){var e=this.__data__,r=N(e,t);return r<0?void 0:e[r][1]}function w(t){return N(this.__data__,t)>-1}function j(t,e){var r=this.__data__,n=N(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function q(){this.__data__={hash:new p,map:new(ge||b),string:new p}}function P(t){return K(this,t).delete(t)}function T(t){return K(this,t).get(t)}function A(t){return K(this,t).has(t)}function C(t,e){return K(this,t).set(t,e),this}function D(t){var e=-1,r=t?t.length:0;for(this.__data__=new O;++e<r;)this.add(t[e])}function x(t){return this.__data__.set(t,ht),this}function S(t){return this.__data__.has(t)}function M(t){this.__data__=new b(t)}function E(){this.__data__=new b}function R(t){return this.__data__.delete(t)}function k(t){return this.__data__.get(t)}function F(t){return this.__data__.has(t)}function Q(t,e){var r=this.__data__;if(r instanceof b){var n=r.__data__;if(!ge||n.length<ft-1)return n.push([t,e]),this;r=this.__data__=new O(n)}return r.set(t,e),this}function I(t,e){var r=Se(t)||nt(t)?o(t.length,String):[],n=r.length,i=!!n;for(var a in t)!e&&!ce.call(t,a)||i&&("length"==a||J(a,n))||r.push(a);return r}function N(t,e){for(var r=t.length;r--;)if(rt(t[r][0],e))return r;return-1}function W(t){return le.call(t)}function L(t,e,r,n,o){return t===e||(null==t||null==e||!ct(t)&&!lt(e)?t!==t&&e!==e:U(t,e,L,r,n,o))}function U(t,e,r,n,o,i){var a=Se(t),u=Se(e),c=gt,l=gt;a||(c=xe(t),c=c==bt?Tt:c),u||(l=xe(e),l=l==bt?Tt:l);var p=c==Tt&&!s(t),f=l==Tt&&!s(e),h=c==l;if(h&&!p)return i||(i=new M),a||Me(t)?Y(t,e,r,n,o,i):B(t,e,c,r,n,o,i);if(!(o&yt)){var d=p&&ce.call(t,"__wrapped__"),y=f&&ce.call(e,"__wrapped__");if(d||y){var v=d?t.value():t,b=y?e.value():e;return i||(i=new M),r(v,b,n,o,i)}}return!!h&&(i||(i=new M),G(t,e,r,n,o,i))}function V(t){if(!ct(t)||Z(t))return!1;var e=st(t)||s(t)?pe:zt;return e.test(et(t))}function $(t){return lt(t)&&ut(t.length)&&!!Bt[le.call(t)]}function z(t){if(!tt(t))return ve(t);var e=[];for(var r in Object(t))ce.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Y(t,e,r,o,i,a){var s=i&yt,u=t.length,c=e.length;if(u!=c&&!(s&&c>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var p=-1,f=!0,h=i&dt?new D:void 0;for(a.set(t,e),a.set(e,t);++p<u;){var d=t[p],y=e[p];if(o)var v=s?o(y,d,p,e,t,a):o(d,y,p,t,e,a);if(void 0!==v){if(v)continue;f=!1;break}if(h){if(!n(e,function(t,e){if(!h.has(e)&&(d===t||r(d,t,o,i,a)))return h.add(e)})){f=!1;break}}else if(d!==y&&!r(d,y,o,i,a)){f=!1;break}}return a.delete(t),a.delete(e),f}function B(t,e,r,n,o,i,a){switch(r){case Rt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Et:return!(t.byteLength!=e.byteLength||!n(new he(t),new he(e)));case mt:case _t:case Pt:return rt(+t,+e);case wt:return t.name==e.name&&t.message==e.message;case Ct:case xt:return t==e+"";case qt:var s=u;case Dt:var c=i&yt;if(s||(s=l),t.size!=e.size&&!c)return!1;var p=a.get(t);if(p)return p==e;i|=dt,a.set(t,e);var f=Y(s(t),s(e),n,o,i,a);return a.delete(t),f;case St:if(De)return De.call(t)==De.call(e)}return!1}function G(t,e,r,n,o,i){var a=o&yt,s=pt(t),u=s.length,c=pt(e),l=c.length;if(u!=l&&!a)return!1;for(var p=u;p--;){var f=s[p];if(!(a?f in e:ce.call(e,f)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var d=!0;i.set(t,e),i.set(e,t);for(var y=a;++p<u;){f=s[p];var v=t[f],b=e[f];if(n)var g=a?n(b,v,f,e,t,i):n(v,b,f,t,e,i);if(!(void 0===g?v===b||r(v,b,n,o,i):g)){d=!1;break}y||(y="constructor"==f)}if(d&&!y){var m=t.constructor,_=e.constructor;m!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return i.delete(t),i.delete(e),d}function K(t,e){var r=t.__data__;return X(e)?r["string"==typeof e?"string":"hash"]:r.map}function H(t,e){var r=a(t,e);return V(r)?r:void 0}function J(t,e){return e=null==e?vt:e,!!e&&("number"==typeof t||Yt.test(t))&&t>-1&&t%1==0&&t<e}function X(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Z(t){return!!se&&se in t}function tt(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||ie;return t===r}function et(t){if(null!=t){try{return ue.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function rt(t,e){return t===e||t!==t&&e!==e}function nt(t){return it(t)&&ce.call(t,"callee")&&(!de.call(t,"callee")||le.call(t)==bt)}function ot(t){return null!=t&&ut(t.length)&&!st(t)}function it(t){return lt(t)&&ot(t)}function at(t,e){return L(t,e)}function st(t){var e=ct(t)?le.call(t):"";return e==jt||e==Ot}function ut(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=vt}function ct(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function lt(t){return!!t&&"object"==typeof t}function pt(t){return ot(t)?I(t):z(t)}var ft=200,ht="__lodash_hash_undefined__",dt=1,yt=2,vt=9007199254740991,bt="[object Arguments]",gt="[object Array]",mt="[object Boolean]",_t="[object Date]",wt="[object Error]",jt="[object Function]",Ot="[object GeneratorFunction]",qt="[object Map]",Pt="[object Number]",Tt="[object Object]",At="[object Promise]",Ct="[object RegExp]",Dt="[object Set]",xt="[object String]",St="[object Symbol]",Mt="[object WeakMap]",Et="[object ArrayBuffer]",Rt="[object DataView]",kt="[object Float32Array]",Ft="[object Float64Array]",Qt="[object Int8Array]",It="[object Int16Array]",Nt="[object Int32Array]",Wt="[object Uint8Array]",Lt="[object Uint8ClampedArray]",Ut="[object Uint16Array]",Vt="[object Uint32Array]",$t=/[\\^$.*+?()[\]{}|]/g,zt=/^\[object .+?Constructor\]$/,Yt=/^(?:0|[1-9]\d*)$/,Bt={};Bt[kt]=Bt[Ft]=Bt[Qt]=Bt[It]=Bt[Nt]=Bt[Wt]=Bt[Lt]=Bt[Ut]=Bt[Vt]=!0,Bt[bt]=Bt[gt]=Bt[Et]=Bt[mt]=Bt[Rt]=Bt[_t]=Bt[wt]=Bt[jt]=Bt[qt]=Bt[Pt]=Bt[Tt]=Bt[Ct]=Bt[Dt]=Bt[xt]=Bt[Mt]=!1;var Gt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,Ht=Gt||Kt||Function("return this")(),Jt="object"==typeof r&&r&&!r.nodeType&&r,Xt=Jt&&"object"==typeof e&&e&&!e.nodeType&&e,Zt=Xt&&Xt.exports===Jt,te=Zt&&Gt.process,ee=function(){try{return te&&te.binding("util")}catch(t){}}(),re=ee&&ee.isTypedArray,ne=Array.prototype,oe=Function.prototype,ie=Object.prototype,ae=Ht["__core-js_shared__"],se=function(){var t=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ue=oe.toString,ce=ie.hasOwnProperty,le=ie.toString,pe=RegExp("^"+ue.call(ce).replace($t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fe=Ht.Symbol,he=Ht.Uint8Array,de=ie.propertyIsEnumerable,ye=ne.splice,ve=c(Object.keys,Object),be=H(Ht,"DataView"),ge=H(Ht,"Map"),me=H(Ht,"Promise"),_e=H(Ht,"Set"),we=H(Ht,"WeakMap"),je=H(Object,"create"),Oe=et(be),qe=et(ge),Pe=et(me),Te=et(_e),Ae=et(we),Ce=fe?fe.prototype:void 0,De=Ce?Ce.valueOf:void 0;p.prototype.clear=f,p.prototype.delete=h,p.prototype.get=d,p.prototype.has=y,p.prototype.set=v,b.prototype.clear=g,b.prototype.delete=m,b.prototype.get=_,b.prototype.has=w,b.prototype.set=j,O.prototype.clear=q,O.prototype.delete=P,O.prototype.get=T,O.prototype.has=A,O.prototype.set=C,D.prototype.add=D.prototype.push=x,D.prototype.has=S,M.prototype.clear=E,M.prototype.delete=R,M.prototype.get=k,M.prototype.has=F,M.prototype.set=Q;var xe=W;(be&&xe(new be(new ArrayBuffer(1)))!=Rt||ge&&xe(new ge)!=qt||me&&xe(me.resolve())!=At||_e&&xe(new _e)!=Dt||we&&xe(new we)!=Mt)&&(xe=function(t){var e=le.call(t),r=e==Tt?t.constructor:void 0,n=r?et(r):void 0;if(n)switch(n){case Oe:return Rt;case qe:return qt;case Pe:return At;case Te:return Dt;case Ae:return Mt}return e});var Se=Array.isArray,Me=re?i(re):$;e.exports=at}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function o(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(t,e){for(var r,o,s=n(t),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var c in r)i.call(r,c)&&(s[c]=r[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(r);for(var l=0;l<o.length;l++)a.call(r,o[l])&&(s[o[l]]=r[o[l]])}}return s}},{}]},{},[3]); |
@@ -24,3 +24,3 @@ import { MutationBehavior, MutationQueryReducersMap } from 'apollo-client/data/mutationResults'; | ||
export interface OperationOption { | ||
options?: (props: any) => QueryOptions | MutationOptions; | ||
options?: Object | ((props: any) => QueryOptions | MutationOptions); | ||
props?: (props: any) => any; | ||
@@ -27,0 +27,0 @@ name?: string; |
@@ -58,2 +58,4 @@ "use strict"; | ||
var mapPropsToOptions = options; | ||
if (typeof mapPropsToOptions !== 'function') | ||
mapPropsToOptions = function () { return options; }; | ||
var mapResultToProps = operationOptions.props; | ||
@@ -173,2 +175,3 @@ var operation = parser_1.parser(document); | ||
GraphQL.prototype.setInitialProps = function () { | ||
var _this = this; | ||
if (this.type === parser_1.DocumentType.Mutation) { | ||
@@ -188,3 +191,15 @@ this.createWrappedMutation(this.props); | ||
}); | ||
queryData = assign({ errors: null, loading: false, variables: variables }, result); | ||
var refetch = function (vars) { | ||
return _this.client.query({ | ||
query: document, | ||
variables: vars, | ||
}); | ||
}; | ||
var fetchMore = function (opts) { | ||
opts.query = document; | ||
return _this.client.query(opts); | ||
}; | ||
queryData = assign({ | ||
errors: null, loading: false, variables: variables, refetch: refetch, fetchMore: fetchMore, | ||
}, result); | ||
} | ||
@@ -359,6 +374,7 @@ catch (e) { } | ||
}; | ||
GraphQL.fetchData = operation.type === parser_1.DocumentType.Query ? fetchData : false; | ||
GraphQL.fragments = operation.fragments; | ||
return GraphQL; | ||
}(react_1.Component)); | ||
if (operation.type === parser_1.DocumentType.Query) | ||
GraphQL.fetchData = fetchData; | ||
return hoistNonReactStatics(GraphQL, WrappedComponent); | ||
@@ -365,0 +381,0 @@ }; |
{ | ||
"name": "react-apollo", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "React data container for Apollo Client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1077916
30558