@vue/apollo-components
Advanced tools
Comparing version 4.0.0-alpha.13 to 4.0.0-alpha.14
@@ -598,3 +598,3 @@ import gql from 'graphql-tag'; | ||
plugin.version = "4.0.0-alpha.13"; // Apollo provider | ||
plugin.version = "4.0.0-alpha.14"; // Apollo provider | ||
@@ -601,0 +601,0 @@ var ApolloProvider = plugin; // Components |
@@ -1,1 +0,1 @@ | ||
var VueApolloComponents=function(t,r,e){"use strict";function o(e,t){var o,r=Object.keys(e);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(e),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)),r}function n(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){var e,o;e=r,t=n[o=t],o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var i={name:"ApolloQuery",provide:function(){return{getDollarApollo:this.getDollarApollo,getApolloQuery:this.getApolloQuery}},props:{query:{type:[Function,Object],required:!0},variables:{type:Object,default:void 0},fetchPolicy:{type:String,default:void 0},pollInterval:{type:Number,default:void 0},notifyOnNetworkStatusChange:{type:Boolean,default:void 0},context:{type:Object,default:void 0},update:{type:Function,default:function(t){return t}},skip:{type:Boolean,default:!1},debounce:{type:Number,default:0},throttle:{type:Number,default:0},clientId:{type:String,default:void 0},deep:{type:Boolean,default:void 0},tag:{type:String,default:"div"},prefetch:{type:Boolean,default:!0},options:{type:Object,default:function(){return{}}}},data:function(){return{result:{data:null,loading:!1,networkStatus:7,error:null},times:0}},watch:{fetchPolicy:function(t){this.$apollo.queries.query.setOptions({fetchPolicy:t})},pollInterval:function(t){this.$apollo.queries.query.setOptions({pollInterval:t})},notifyOnNetworkStatusChange:function(t){this.$apollo.queries.query.setOptions({notifyOnNetworkStatusChange:t})},"$data.$apolloData.loading":function(t){this.$emit("loading",!!t)}},apollo:{$client:function(){return this.clientId},query:function(){return n(n({query:function(){return"function"==typeof this.query?this.query(r):this.query},variables:function(){return this.variables},fetchPolicy:this.fetchPolicy,pollInterval:this.pollInterval,debounce:this.debounce,throttle:this.throttle,notifyOnNetworkStatusChange:this.notifyOnNetworkStatusChange,context:function(){return this.context},skip:function(){return this.skip},deep:this.deep,prefetch:this.prefetch},this.options),{},{manual:!0,result:function(t){console.log(t);var e=t,o=e.errors,r=e.loading,n=e.networkStatus,e=t.error;t=Object.assign({},t),o&&o.length&&((e=new Error("Apollo errors occurred (".concat(o.length,")"))).graphQLErrors=o);o={};r?Object.assign(o,this.$_previousData,t.data):e?Object.assign(o,this.$apollo.queries.query.observer.getLastResult()||{},t.data):(o=t.data,this.$_previousData=t.data);t=o,t=0<Object.keys(t).length;this.result={data:t?this.update(o):void 0,fullData:t?o:void 0,loading:r,error:e,networkStatus:n},this.times=++this.$_times,this.$emit("result",this.result)},error:function(t){this.result.loading=!1,this.result.error=t,this.$emit("error",t)}})}},created:function(){this.$_times=0},methods:{getDollarApollo:function(){return this.$apollo},getApolloQuery:function(){return this.$apollo.queries.query}},render:function(){var t=this.$slots.default({result:this.result,times:this.times,query:this.$apollo.queries.query,isLoading:this.$apolloData.loading,gqlError:this.result&&this.result.error&&this.result.error.gqlError});return this.tag?e.h(this.tag,t):t}},l=0,u={name:"ApolloSubscribeToMore",inject:["getDollarApollo","getApolloQuery"],props:{document:{type:[Function,Object],required:!0},variables:{type:Object,default:void 0},updateQuery:{type:Function,default:void 0}},watch:{document:"refresh",variables:"refresh"},created:function(){this.$_key="sub_component_".concat(l++)},mounted:function(){this.refresh()},beforeDestroy:function(){this.destroy()},methods:{destroy:function(){this.$_sub&&this.$_sub.destroy()},refresh:function(){this.destroy();var t=this.document;"function"==typeof t&&(t=t(r)),this.$_sub=this.getDollarApollo().addSmartSubscription(this.$_key,{document:t,variables:this.variables,updateQuery:this.updateQuery,linkedQuery:this.getApolloQuery()})}},render:function(){return null}};var a,s,c=(function(t){function r(l,u,a,s){var c,p=!1,d=0;function h(){c&&clearTimeout(c)}function t(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];var r=this,n=Date.now()-d;function i(){d=Date.now(),a.apply(r,e)}p||(s&&!c&&i(),h(),void 0===s&&l<n?i():!0!==u&&(c=setTimeout(s?function(){c=void 0}:i,void 0===s?l-n:l)))}return"boolean"!=typeof u&&(s=a,a=u,u=void 0),t.cancel=function(){h(),p=!0},t}(t=t).debounce=function(t,e,o){return void 0===o?r(t,e,!1):r(t,o,!1!==e)},t.throttle=r,Object.defineProperty(t,"__esModule",{value:!0})}((a={exports:{}},a.exports)),a.exports);function p(o){return function(t,e){return o(e,t)}}(s=c)&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")&&s.default;p(c.throttle),p(c.debounce);var d={props:{mutation:{type:[Function,Object],required:!0},variables:{type:Object,default:void 0},optimisticResponse:{type:Object,default:void 0},update:{type:Function,default:void 0},refetchQueries:{type:Function,default:void 0},clientId:{type:String,default:void 0},tag:{type:String,default:"div"}},data:function(){return{loading:!1,error:null}},watch:{loading:function(t){this.$emit("loading",t)}},methods:{mutate:function(t){var o=this;this.loading=!0,this.error=null;var e=this.mutation;"function"==typeof e&&(e=e(r)),this.$apollo.mutate(n({mutation:e,client:this.clientId,variables:this.variables,optimisticResponse:this.optimisticResponse,update:this.update,refetchQueries:this.refetchQueries},t)).then(function(t){o.$emit("done",t),o.loading=!1}).catch(function(t){var e;(e=t).graphQLErrors&&e.graphQLErrors.length&&(e.gqlError=e.graphQLErrors[0]),o.error=t,o.$emit("error",t),o.loading=!1})}},render:function(){var t=this.$slots.default({mutate:this.mutate,loading:this.loading,error:this.error,gqlError:this.error&&this.error.gqlError});return this.tag?e.h(this.tag,t):t}},h={};function f(t,e){t.component("ApolloQuery",i),t.component("ApolloQuery",i),t.component("ApolloSubscribeToMore",u),t.component("ApolloSubscribeToMore",u),t.component("ApolloMutation",d),t.component("ApolloMutation",d)}h.install=f,h.version="4.0.0-alpha.13";var y=h,g=i,b=u,v=d,m=null;return"undefined"!=typeof window?m=window.Vue:"undefined"!=typeof global&&(m=global.Vue),m&&m.use(h),t.ApolloMutation=v,t.ApolloProvider=y,t.ApolloQuery=g,t.ApolloSubscribeToMore=b,t.default=h,t.install=f,t}({},gql,vue); | ||
var VueApolloComponents=function(t,r,e){"use strict";function o(e,t){var o,r=Object.keys(e);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(e),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)),r}function n(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){var e,o;e=r,t=n[o=t],o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var i={name:"ApolloQuery",provide:function(){return{getDollarApollo:this.getDollarApollo,getApolloQuery:this.getApolloQuery}},props:{query:{type:[Function,Object],required:!0},variables:{type:Object,default:void 0},fetchPolicy:{type:String,default:void 0},pollInterval:{type:Number,default:void 0},notifyOnNetworkStatusChange:{type:Boolean,default:void 0},context:{type:Object,default:void 0},update:{type:Function,default:function(t){return t}},skip:{type:Boolean,default:!1},debounce:{type:Number,default:0},throttle:{type:Number,default:0},clientId:{type:String,default:void 0},deep:{type:Boolean,default:void 0},tag:{type:String,default:"div"},prefetch:{type:Boolean,default:!0},options:{type:Object,default:function(){return{}}}},data:function(){return{result:{data:null,loading:!1,networkStatus:7,error:null},times:0}},watch:{fetchPolicy:function(t){this.$apollo.queries.query.setOptions({fetchPolicy:t})},pollInterval:function(t){this.$apollo.queries.query.setOptions({pollInterval:t})},notifyOnNetworkStatusChange:function(t){this.$apollo.queries.query.setOptions({notifyOnNetworkStatusChange:t})},"$data.$apolloData.loading":function(t){this.$emit("loading",!!t)}},apollo:{$client:function(){return this.clientId},query:function(){return n(n({query:function(){return"function"==typeof this.query?this.query(r):this.query},variables:function(){return this.variables},fetchPolicy:this.fetchPolicy,pollInterval:this.pollInterval,debounce:this.debounce,throttle:this.throttle,notifyOnNetworkStatusChange:this.notifyOnNetworkStatusChange,context:function(){return this.context},skip:function(){return this.skip},deep:this.deep,prefetch:this.prefetch},this.options),{},{manual:!0,result:function(t){console.log(t);var e=t,o=e.errors,r=e.loading,n=e.networkStatus,e=t.error;t=Object.assign({},t),o&&o.length&&((e=new Error("Apollo errors occurred (".concat(o.length,")"))).graphQLErrors=o);o={};r?Object.assign(o,this.$_previousData,t.data):e?Object.assign(o,this.$apollo.queries.query.observer.getLastResult()||{},t.data):(o=t.data,this.$_previousData=t.data);t=o,t=0<Object.keys(t).length;this.result={data:t?this.update(o):void 0,fullData:t?o:void 0,loading:r,error:e,networkStatus:n},this.times=++this.$_times,this.$emit("result",this.result)},error:function(t){this.result.loading=!1,this.result.error=t,this.$emit("error",t)}})}},created:function(){this.$_times=0},methods:{getDollarApollo:function(){return this.$apollo},getApolloQuery:function(){return this.$apollo.queries.query}},render:function(){var t=this.$slots.default({result:this.result,times:this.times,query:this.$apollo.queries.query,isLoading:this.$apolloData.loading,gqlError:this.result&&this.result.error&&this.result.error.gqlError});return this.tag?e.h(this.tag,t):t}},l=0,u={name:"ApolloSubscribeToMore",inject:["getDollarApollo","getApolloQuery"],props:{document:{type:[Function,Object],required:!0},variables:{type:Object,default:void 0},updateQuery:{type:Function,default:void 0}},watch:{document:"refresh",variables:"refresh"},created:function(){this.$_key="sub_component_".concat(l++)},mounted:function(){this.refresh()},beforeDestroy:function(){this.destroy()},methods:{destroy:function(){this.$_sub&&this.$_sub.destroy()},refresh:function(){this.destroy();var t=this.document;"function"==typeof t&&(t=t(r)),this.$_sub=this.getDollarApollo().addSmartSubscription(this.$_key,{document:t,variables:this.variables,updateQuery:this.updateQuery,linkedQuery:this.getApolloQuery()})}},render:function(){return null}};var a,s,c=(function(t){function r(l,u,a,s){var c,p=!1,d=0;function h(){c&&clearTimeout(c)}function t(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];var r=this,n=Date.now()-d;function i(){d=Date.now(),a.apply(r,e)}p||(s&&!c&&i(),h(),void 0===s&&l<n?i():!0!==u&&(c=setTimeout(s?function(){c=void 0}:i,void 0===s?l-n:l)))}return"boolean"!=typeof u&&(s=a,a=u,u=void 0),t.cancel=function(){h(),p=!0},t}(t=t).debounce=function(t,e,o){return void 0===o?r(t,e,!1):r(t,o,!1!==e)},t.throttle=r,Object.defineProperty(t,"__esModule",{value:!0})}((a={exports:{}},a.exports)),a.exports);function p(o){return function(t,e){return o(e,t)}}(s=c)&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")&&s.default;p(c.throttle),p(c.debounce);var d={props:{mutation:{type:[Function,Object],required:!0},variables:{type:Object,default:void 0},optimisticResponse:{type:Object,default:void 0},update:{type:Function,default:void 0},refetchQueries:{type:Function,default:void 0},clientId:{type:String,default:void 0},tag:{type:String,default:"div"}},data:function(){return{loading:!1,error:null}},watch:{loading:function(t){this.$emit("loading",t)}},methods:{mutate:function(t){var o=this;this.loading=!0,this.error=null;var e=this.mutation;"function"==typeof e&&(e=e(r)),this.$apollo.mutate(n({mutation:e,client:this.clientId,variables:this.variables,optimisticResponse:this.optimisticResponse,update:this.update,refetchQueries:this.refetchQueries},t)).then(function(t){o.$emit("done",t),o.loading=!1}).catch(function(t){var e;(e=t).graphQLErrors&&e.graphQLErrors.length&&(e.gqlError=e.graphQLErrors[0]),o.error=t,o.$emit("error",t),o.loading=!1})}},render:function(){var t=this.$slots.default({mutate:this.mutate,loading:this.loading,error:this.error,gqlError:this.error&&this.error.gqlError});return this.tag?e.h(this.tag,t):t}},h={};function f(t,e){t.component("ApolloQuery",i),t.component("ApolloQuery",i),t.component("ApolloSubscribeToMore",u),t.component("ApolloSubscribeToMore",u),t.component("ApolloMutation",d),t.component("ApolloMutation",d)}h.install=f,h.version="4.0.0-alpha.14";var y=h,g=i,b=u,v=d,m=null;return"undefined"!=typeof window?m=window.Vue:"undefined"!=typeof global&&(m=global.Vue),m&&m.use(h),t.ApolloMutation=v,t.ApolloProvider=y,t.ApolloQuery=g,t.ApolloSubscribeToMore=b,t.default=h,t.install=f,t}({},gql,vue); |
@@ -603,3 +603,3 @@ (function (global, factory) { | ||
plugin.version = "4.0.0-alpha.13"; // Apollo provider | ||
plugin.version = "4.0.0-alpha.14"; // Apollo provider | ||
@@ -606,0 +606,0 @@ var ApolloProvider = plugin; // Components |
{ | ||
"name": "@vue/apollo-components", | ||
"version": "4.0.0-alpha.13", | ||
"version": "4.0.0-alpha.14", | ||
"description": "Apollo GraphQL components for Vue.js", | ||
@@ -36,3 +36,3 @@ "main": "dist/vue-apollo-components.umd.js", | ||
"dependencies": { | ||
"@vue/apollo-option": "^4.0.0-alpha.13" | ||
"@vue/apollo-option": "^4.0.0-alpha.14" | ||
}, | ||
@@ -72,3 +72,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "60e7ee3b24ad95ca04eeb65c86b914f6407b623d" | ||
"gitHead": "27c12e9f941e4a5b796b01a833299b068adf8bc7" | ||
} |
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