Socket
Socket
Sign inDemoInstall

@apollo/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo/react-hooks - npm Package Compare versions

Comparing version 0.1.0-beta.11 to 0.1.0-beta.12

35

lib/data/MutationData.js

@@ -11,2 +11,17 @@ import * as tslib_1 from "tslib";

var _this = _super.call(this, options, context) || this;
_this.runMutation = function (mutationFunctionOptions) {
if (mutationFunctionOptions === void 0) { mutationFunctionOptions = {}; }
_this.onMutationStart();
var mutationId = _this.generateNewMutationId();
return _this.mutate(mutationFunctionOptions)
.then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
})
.catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError)
throw error;
});
};
_this.verifyDocumentType(options.mutation, DocumentType.Mutation);

@@ -19,7 +34,5 @@ _this.result = result;

MutationData.prototype.execute = function (result) {
var _this = this;
this.isMounted = true;
this.verifyDocumentType(this.getOptions().mutation, DocumentType.Mutation);
var runMutation = function (options) { return _this.runMutation(options); };
return [runMutation, result];
return [this.runMutation, result];
};

@@ -32,18 +45,2 @@ MutationData.prototype.afterExecute = function () {

};
MutationData.prototype.runMutation = function (mutationFunctionOptions) {
var _this = this;
if (mutationFunctionOptions === void 0) { mutationFunctionOptions = {}; }
this.onMutationStart();
var mutationId = this.generateNewMutationId();
return this.mutate(mutationFunctionOptions)
.then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
})
.catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError)
throw error;
});
};
MutationData.prototype.mutate = function (mutationFunctionOptions) {

@@ -50,0 +47,0 @@ var _a = this.getOptions(), mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, mutationContext = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy;

@@ -27,3 +27,2 @@ import { ApolloQueryResult } from 'apollo-client';

private getExecuteSsrResult;
private updateCurrentData;
private prepareObservableQueryOptions;

@@ -30,0 +29,0 @@ private observableQueryFields;

@@ -70,2 +70,3 @@ import * as tslib_1 from "tslib";

QueryData.prototype.afterExecute = function (_a) {
var _this = this;
var _b = (_a === void 0 ? {} : _a).lazy, lazy = _b === void 0 ? false : _b;

@@ -75,2 +76,6 @@ this.isMounted = true;

this.handleErrorOrCompleted();
setTimeout(function () {
_this.currentObservable.query &&
_this.currentObservable.query.resetQueryStoreErrors();
});
}

@@ -109,7 +114,2 @@ return this.unmount.bind(this);

};
QueryData.prototype.updateCurrentData = function () {
if (this.isMounted) {
this.forceUpdate();
}
};
QueryData.prototype.prepareObservableQueryOptions = function () {

@@ -167,3 +167,3 @@ this.verifyDocumentType(this.getOptions().query, DocumentType.Query);

}
_this.updateCurrentData();
_this.forceUpdate();
},

@@ -174,3 +174,3 @@ error: function (error) {

throw error;
_this.updateCurrentData();
_this.forceUpdate();
}

@@ -191,3 +191,2 @@ });

QueryData.prototype.getQueryResult = function () {
var _this = this;
var result = {

@@ -238,5 +237,2 @@ data: Object.create(null)

}
setTimeout(function () {
_this.currentObservable.query.resetQueryStoreErrors();
});
result.client = this.client;

@@ -243,0 +239,0 @@ this.previousData.loading =

@@ -173,2 +173,4 @@ exports.__esModule = true;

QueryData.prototype.afterExecute = function (_a) {
var _this = this;
var _b = (_a === void 0 ? {} : _a).lazy,

@@ -180,2 +182,5 @@ lazy = _b === void 0 ? false : _b;

this.handleErrorOrCompleted();
setTimeout(function () {
_this.currentObservable.query && _this.currentObservable.query.resetQueryStoreErrors();
});
}

@@ -228,8 +233,2 @@

QueryData.prototype.updateCurrentData = function () {
if (this.isMounted) {
this.forceUpdate();
}
};
QueryData.prototype.prepareObservableQueryOptions = function () {

@@ -305,3 +304,3 @@ this.verifyDocumentType(this.getOptions().query, _reactCommon.DocumentType.Query);

_this.updateCurrentData();
_this.forceUpdate();
},

@@ -313,3 +312,3 @@ error: function (error) {

_this.updateCurrentData();
_this.forceUpdate();
}

@@ -332,4 +331,2 @@ });

QueryData.prototype.getQueryResult = function () {
var _this = this;
var result = {

@@ -394,5 +391,2 @@ data: Object.create(null)

setTimeout(function () {
_this.currentObservable.query.resetQueryStoreErrors();
});
result.client = this.client;

@@ -496,2 +490,7 @@ this.previousData.loading = this.previousData.result && this.previousData.result.loading || false;

}, [result]);
(0, _react.useEffect)(function () {
return function () {
return queryData.cleanup();
};
}, []);
return result;

@@ -519,2 +518,22 @@ }

_this.runMutation = function (mutationFunctionOptions) {
if (mutationFunctionOptions === void 0) {
mutationFunctionOptions = {};
}
_this.onMutationStart();
var mutationId = _this.generateNewMutationId();
return _this.mutate(mutationFunctionOptions).then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
}).catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError) throw error;
});
};
_this.verifyDocumentType(options.mutation, _reactCommon.DocumentType.Mutation);

@@ -529,12 +548,5 @@

MutationData.prototype.execute = function (result) {
var _this = this;
this.isMounted = true;
this.verifyDocumentType(this.getOptions().mutation, _reactCommon.DocumentType.Mutation);
var runMutation = function (options) {
return _this.runMutation(options);
};
return [runMutation, result];
return [this.runMutation, result];
};

@@ -549,22 +561,2 @@

MutationData.prototype.runMutation = function (mutationFunctionOptions) {
var _this = this;
if (mutationFunctionOptions === void 0) {
mutationFunctionOptions = {};
}
this.onMutationStart();
var mutationId = this.generateNewMutationId();
return this.mutate(mutationFunctionOptions).then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
}).catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError) throw error;
});
};
MutationData.prototype.mutate = function (mutationFunctionOptions) {

@@ -571,0 +563,0 @@ var _a = this.getOptions(),

@@ -1,1 +0,1 @@

exports.__esModule=!0,exports.useApolloClient=function(){var e=r.default.useContext((0,t.getApolloContext)()).client;return(0,o.invariant)(e,1),e},exports.useLazyQuery=function(t,e){return a(t,e,!0)},exports.useMutation=function(i,s){var o=(0,r.useContext)((0,t.getApolloContext)()),n=(0,r.useState)({called:!1,loading:!1}),u=n[0],a=n[1],c=s?(0,e.__assign)({},s,{mutation:i}):{mutation:i},l=(0,r.useRef)();var h=function(){l.current||(l.current=new p({options:c,context:o,result:u,setResult:a}));return l.current}();return h.setOptions(c),h.context=o,(0,r.useEffect)(function(){return h.afterExecute()}),h.execute(u)},exports.useQuery=function(t,e){return a(t,e,!1)},exports.useSubscription=function(i,s){var o=(0,r.useContext)((0,t.getApolloContext)()),n=(0,r.useState)({loading:!0,error:void 0,data:void 0}),u=n[0],a=n[1],p=s?(0,e.__assign)({},s,{subscription:i}):{subscription:i},l=(0,r.useRef)();var h=function(){l.current||(l.current=new c({options:p,context:o,setResult:a}));return l.current}();return h.setOptions(p),h.context=o,(0,r.useEffect)(function(){return h.afterExecute()}),(0,r.useEffect)(function(){return h.cleanup.bind(h)},[]),h.execute(u)},exports.RenderPromises=exports.resetApolloContext=exports.ApolloProvider=exports.ApolloConsumer=void 0;var t=require("@apollo/react-common");exports.getApolloContext=t.getApolloContext,exports.ApolloConsumer=t.ApolloConsumer,exports.ApolloProvider=t.ApolloProvider,exports.resetApolloContext=t.resetApolloContext;var e=require("tslib"),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};i.get||i.set?Object.defineProperty(e,r,i):e[r]=t[r]}return e.default=t,e}(require("react")),i=require("apollo-client"),s=require("@wry/equality"),o=require("ts-invariant");var n=function(){function e(t,e){this.isMounted=!1,this.previousOptions={},this.context={},this.options={},this.options=t||{},this.context=e||{}}return e.prototype.getOptions=function(){return this.options},e.prototype.setOptions=function(t){(0,s.equal)(this.options,t)||(this.previousOptions=this.options),this.options=t},e.prototype.unmount=function(){this.isMounted=!1},e.prototype.refreshClient=function(){var t=this.options&&this.options.client||this.context&&this.context.client;(0,o.invariant)(!!t,2);var e=!1;return t!==this.client&&(e=!0,this.client=t,this.cleanup()),{client:this.client,isNew:e}},e.prototype.verifyDocumentType=function(e,r){var i=(0,t.parser)(e);(0,t.operationName)(r),(0,t.operationName)(i.type);(0,o.invariant)(i.type===r,3)},e}(),u=function(r){function o(t){var e=t.options,i=t.context,s=t.forceUpdate,o=r.call(this,e,i)||this;return o.previousData={},o.currentObservable={},o.runLazy=!1,o.runLazyQuery=function(t){o.runLazy=!0,o.lazyOptions=t,o.forceUpdate()},o.getExecuteResult=function(){var t=o.getQueryResult();return o.startQuerySubscription(),t},o.forceUpdate=s,o}return(0,e.__extends)(o,r),o.prototype.execute=function(){this.refreshClient();var t=this.getOptions(),e=t.skip,r=t.query;return(e||r!==this.previousData.query)&&(this.removeQuerySubscription(),this.previousData.query=r),this.updateObservableQuery(),this.isMounted&&this.startQuerySubscription(),this.getExecuteSsrResult()||this.getExecuteResult()},o.prototype.executeLazy=function(){return this.runLazy?[this.runLazyQuery,this.execute()]:[this.runLazyQuery,{loading:!1,networkStatus:i.NetworkStatus.ready,called:!1,data:void 0}]},o.prototype.fetchData=function(){if(this.getOptions().skip)return!1;var t=this.getOptions(),r=(t.children,t.ssr),i=(t.displayName,t.skip,t.onCompleted,t.onError,t.partialRefetch,(0,e.__rest)(t,["children","ssr","displayName","skip","onCompleted","onError","partialRefetch"])),s=i.fetchPolicy;if(!1===r)return!1;"network-only"!==s&&"cache-and-network"!==s||(s="cache-first");var o=this.refreshClient().client.watchQuery((0,e.__assign)({},i,{fetchPolicy:s}));return this.context&&this.context.renderPromises&&this.context.renderPromises.registerSSRObservable(o,this.getOptions()),!!this.currentObservable.query.getCurrentResult().loading&&o.result()},o.prototype.afterExecute=function(t){var e=(void 0===t?{}:t).lazy,r=void 0!==e&&e;return this.isMounted=!0,r&&!this.runLazy||this.handleErrorOrCompleted(),this.unmount.bind(this)},o.prototype.cleanup=function(){this.removeQuerySubscription(),delete this.currentObservable.query,delete this.previousData.result},o.prototype.getOptions=function(){var t=r.prototype.getOptions.call(this),i=this.lazyOptions||{},s=(0,e.__assign)({},t,{variables:(0,e.__assign)({},t.variables,i.variables),context:(0,e.__assign)({},t.context,i.context)});return this.runLazy&&delete s.skip,s},o.prototype.getExecuteSsrResult=function(){var t,e={loading:!0,networkStatus:i.NetworkStatus.loading,called:!0,data:{}};return this.context&&this.context.renderPromises&&((t=this.context.renderPromises.addQueryPromise(this,this.getExecuteResult))||(t=e)),t},o.prototype.updateCurrentData=function(){this.isMounted&&this.forceUpdate()},o.prototype.prepareObservableQueryOptions=function(){this.verifyDocumentType(this.getOptions().query,t.DocumentType.Query);var r=this.getOptions().displayName||"Query";return(0,e.__assign)({},this.getOptions(),{displayName:r,context:this.getOptions().context||{},metadata:{reactComponent:{displayName:r}}})},o.prototype.observableQueryFields=function(t){return{variables:t.variables,refetch:t.refetch.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}},o.prototype.initializeObservableQuery=function(){if(this.context&&this.context.renderPromises&&(this.currentObservable.query=this.context.renderPromises.getSSRObservable(this.getOptions())),!this.currentObservable.query){var t=this.prepareObservableQueryOptions();this.previousData.observableQueryOptions=(0,e.__assign)({},t,{children:null}),this.currentObservable.query=this.refreshClient().client.watchQuery(t)}},o.prototype.updateObservableQuery=function(){this.currentObservable.query||this.initializeObservableQuery();var t=(0,e.__assign)({},this.prepareObservableQueryOptions(),{children:null});(0,s.equal)(t,this.previousData.observableQueryOptions)||(this.previousData.observableQueryOptions=t,this.currentObservable.query.setOptions(t).catch(function(){}))},o.prototype.startQuerySubscription=function(){var t=this;if(!this.currentObservable.subscription&&!this.getOptions().skip){var e=this.currentObservable.query;this.currentObservable.subscription=e.subscribe({next:function(e){var r=e.loading,i=e.networkStatus,o=e.data;t.previousData.result&&t.previousData.result.loading===r&&t.previousData.result.networkStatus===i&&(0,s.equal)(t.previousData.result.data,o||{})||t.updateCurrentData()},error:function(e){if(t.resubscribeToQuery(),!e.hasOwnProperty("graphQLErrors"))throw e;t.updateCurrentData()}})}},o.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var t=this.currentObservable.query.getLastError(),e=this.currentObservable.query.getLastResult();this.currentObservable.query.resetLastResults(),this.startQuerySubscription(),Object.assign(this.currentObservable.query,{lastError:t,lastResult:e})},o.prototype.getQueryResult=function(){var t=this,r={data:Object.create(null)};if(Object.assign(r,this.observableQueryFields(this.currentObservable.query)),this.getOptions().skip)r=(0,e.__assign)({},r,{data:void 0,error:void 0,loading:!1,called:!0});else{var s=this.currentObservable.query.getCurrentResult(),o=s.loading,n=s.partial,u=s.networkStatus,a=s.errors,p=s.error,c=s.data;if(c=c||Object.create(null),a&&a.length>0&&(p=new i.ApolloError({graphQLErrors:a})),Object.assign(r,{loading:o,networkStatus:u,error:p,called:!0}),o){var l=this.previousData.result?this.previousData.result.data:{};Object.assign(r.data,l,c)}else if(p)Object.assign(r,{data:(this.currentObservable.query.getLastResult()||{}).data});else{var h=this.currentObservable.query.options.fetchPolicy;if(this.getOptions().partialRefetch&&0===Object.keys(c).length&&n&&"cache-only"!==h)return Object.assign(r,{loading:!0,networkStatus:i.NetworkStatus.loading}),r.refetch(),r;Object.assign(r.data,c)}}return setTimeout(function(){t.currentObservable.query.resetQueryStoreErrors()}),r.client=this.client,this.previousData.loading=this.previousData.result&&this.previousData.result.loading||!1,this.previousData.result=r,r},o.prototype.handleErrorOrCompleted=function(){var t=this.currentObservable.query.getCurrentResult(),e=t.data,r=t.loading,i=t.error;if(!r){var o=this.getOptions(),n=o.query,u=o.variables,a=o.onCompleted,p=o.onError;if(this.previousOptions&&!this.previousData.loading&&(0,s.equal)(this.previousOptions.query,n)&&(0,s.equal)(this.previousOptions.variables,u))return;a&&!i?a(e):p&&i&&p(i)}},o.prototype.removeQuerySubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},o}(n);function a(i,o,n){void 0===n&&(n=!1);var a=(0,r.useContext)((0,t.getApolloContext)()),p=(0,r.useReducer)(function(t){return t+1},0),c=p[0],l=p[1],h=o?(0,e.__assign)({},o,{query:i}):{query:i},b=(0,r.useRef)();b.current||(b.current=new u({options:h,context:a,forceUpdate:l}));var v=b.current;v.setOptions(h),v.context=a;var y,d,f,g=(y=function(){return n?v.executeLazy():v.execute()},d={options:h,context:a,tick:c},(f=(0,r.useRef)()).current&&(0,s.equal)(d,f.current.key)||(f.current={key:d,value:y()}),f.current.value);return(0,r.useEffect)(function(){return v.afterExecute({lazy:n})},[g]),g}var p=function(r){function o(e){var i=e.options,s=e.context,o=e.result,n=e.setResult,u=r.call(this,i,s)||this;return u.verifyDocumentType(i.mutation,t.DocumentType.Mutation),u.result=o,u.setResult=n,u.mostRecentMutationId=0,u}return(0,e.__extends)(o,r),o.prototype.execute=function(e){var r=this;this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,t.DocumentType.Mutation);return[function(t){return r.runMutation(t)},e]},o.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},o.prototype.cleanup=function(){},o.prototype.runMutation=function(t){var e=this;void 0===t&&(t={}),this.onMutationStart();var r=this.generateNewMutationId();return this.mutate(t).then(function(t){return e.onMutationCompleted(t,r),t}).catch(function(t){if(e.onMutationError(t,r),!e.getOptions().onError)throw t})},o.prototype.mutate=function(t){var r=this.getOptions(),i=r.mutation,s=r.variables,o=r.optimisticResponse,n=r.update,u=r.context,a=void 0===u?{}:u,p=r.awaitRefetchQueries,c=void 0!==p&&p,l=r.fetchPolicy,h=(0,e.__assign)({},t),b=Object.assign({},s,h.variables);return delete h.variables,this.refreshClient().client.mutate((0,e.__assign)({mutation:i,optimisticResponse:o,refetchQueries:h.refetchQueries||this.getOptions().refetchQueries,awaitRefetchQueries:c,update:n,context:a,fetchPolicy:l,variables:b},h))},o.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},o.prototype.onMutationCompleted=function(t,e){var r=this.getOptions(),s=r.onCompleted,o=r.ignoreResults,n=t.data,u=t.errors,a=u&&u.length>0?new i.ApolloError({graphQLErrors:u}):void 0;this.isMostRecentMutation(e)&&!o&&this.updateResult({called:!0,loading:!1,data:n,error:a}),s&&s(n)},o.prototype.onMutationError=function(t,e){var r=this.getOptions().onError;this.isMostRecentMutation(e)&&this.updateResult({loading:!1,error:t,data:void 0,called:!0}),r&&r(t)},o.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},o.prototype.isMostRecentMutation=function(t){return this.mostRecentMutationId===t},o.prototype.updateResult=function(t){!this.isMounted||this.previousResult&&(0,s.equal)(this.previousResult,t)||(this.setResult(t),this.previousResult=t)},o}(n);var c=function(t){function r(e){var r=e.options,i=e.context,s=e.setResult,o=t.call(this,r,i)||this;return o.currentObservable={},o.setResult=s,o.initialize(r),o}return(0,e.__extends)(r,t),r.prototype.execute=function(t){var r=t;this.refreshClient().isNew&&(r=this.getLoadingResult());var i=this.getOptions().shouldResubscribe;return"function"==typeof i&&(i=!!i(this.getOptions())),!1!==i&&this.previousOptions&&Object.keys(this.previousOptions).length>0&&(this.previousOptions.subscription!==this.getOptions().subscription||!(0,s.equal)(this.previousOptions.variables,this.getOptions().variables))&&(this.endSubscription(),delete this.currentObservable.query,r=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),(0,e.__assign)({},r,{variables:this.getOptions().variables})},r.prototype.afterExecute=function(){this.isMounted=!0},r.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},r.prototype.initialize=function(t){this.currentObservable.query||(this.currentObservable.query=this.refreshClient().client.subscribe({query:t.subscription,variables:t.variables,fetchPolicy:t.fetchPolicy}))},r.prototype.startSubscription=function(){this.currentObservable.subscription||(this.currentObservable.subscription=this.currentObservable.query.subscribe({next:this.updateCurrentData.bind(this),error:this.updateError.bind(this),complete:this.completeSubscription.bind(this)}))},r.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},r.prototype.updateResult=function(t){this.isMounted&&this.setResult(t)},r.prototype.updateCurrentData=function(t){var e=this.getOptions().onSubscriptionData;this.updateResult({data:t.data,loading:!1,error:void 0}),e&&e({client:this.refreshClient().client,subscriptionData:t})},r.prototype.updateError=function(t){this.updateResult({error:t,loading:!1})},r.prototype.completeSubscription=function(){var t=this.getOptions().onSubscriptionComplete;t&&t(),this.endSubscription()},r.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},r}(n);var l=function(){function t(){this.queryPromises=new Map,this.queryInfoTrie=new Map}return t.prototype.registerSSRObservable=function(t,e){this.lookupQueryInfo(e).observable=t},t.prototype.getSSRObservable=function(t){return this.lookupQueryInfo(t).observable},t.prototype.addQueryPromise=function(t,e){return this.lookupQueryInfo(t.getOptions()).seen?e():(this.queryPromises.set(t.getOptions(),new Promise(function(e){e(t.fetchData())})),null)},t.prototype.hasPromises=function(){return this.queryPromises.size>0},t.prototype.consumeAndAwaitPromises=function(){var t=this,e=[];return this.queryPromises.forEach(function(r,i){t.lookupQueryInfo(i).seen=!0,e.push(r)}),this.queryPromises.clear(),Promise.all(e)},t.prototype.lookupQueryInfo=function(t){var e=this.queryInfoTrie,r=t.query,i=t.variables,s=e.get(r)||new Map;e.has(r)||e.set(r,s);var o=JSON.stringify(i),n=s.get(o)||{seen:!1,observable:null};return s.has(o)||s.set(o,n),n},t}();exports.RenderPromises=l;
exports.__esModule=!0,exports.useApolloClient=function(){var e=r.default.useContext((0,t.getApolloContext)()).client;return(0,o.invariant)(e,1),e},exports.useLazyQuery=function(t,e){return a(t,e,!0)},exports.useMutation=function(i,s){var o=(0,r.useContext)((0,t.getApolloContext)()),n=(0,r.useState)({called:!1,loading:!1}),u=n[0],a=n[1],c=s?(0,e.__assign)({},s,{mutation:i}):{mutation:i},l=(0,r.useRef)();var h=function(){l.current||(l.current=new p({options:c,context:o,result:u,setResult:a}));return l.current}();return h.setOptions(c),h.context=o,(0,r.useEffect)(function(){return h.afterExecute()}),h.execute(u)},exports.useQuery=function(t,e){return a(t,e,!1)},exports.useSubscription=function(i,s){var o=(0,r.useContext)((0,t.getApolloContext)()),n=(0,r.useState)({loading:!0,error:void 0,data:void 0}),u=n[0],a=n[1],p=s?(0,e.__assign)({},s,{subscription:i}):{subscription:i},l=(0,r.useRef)();var h=function(){l.current||(l.current=new c({options:p,context:o,setResult:a}));return l.current}();return h.setOptions(p),h.context=o,(0,r.useEffect)(function(){return h.afterExecute()}),(0,r.useEffect)(function(){return h.cleanup.bind(h)},[]),h.execute(u)},exports.RenderPromises=exports.resetApolloContext=exports.ApolloProvider=exports.ApolloConsumer=void 0;var t=require("@apollo/react-common");exports.getApolloContext=t.getApolloContext,exports.ApolloConsumer=t.ApolloConsumer,exports.ApolloProvider=t.ApolloProvider,exports.resetApolloContext=t.resetApolloContext;var e=require("tslib"),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,r):{};i.get||i.set?Object.defineProperty(e,r,i):e[r]=t[r]}return e.default=t,e}(require("react")),i=require("apollo-client"),s=require("@wry/equality"),o=require("ts-invariant");var n=function(){function e(t,e){this.isMounted=!1,this.previousOptions={},this.context={},this.options={},this.options=t||{},this.context=e||{}}return e.prototype.getOptions=function(){return this.options},e.prototype.setOptions=function(t){(0,s.equal)(this.options,t)||(this.previousOptions=this.options),this.options=t},e.prototype.unmount=function(){this.isMounted=!1},e.prototype.refreshClient=function(){var t=this.options&&this.options.client||this.context&&this.context.client;(0,o.invariant)(!!t,2);var e=!1;return t!==this.client&&(e=!0,this.client=t,this.cleanup()),{client:this.client,isNew:e}},e.prototype.verifyDocumentType=function(e,r){var i=(0,t.parser)(e);(0,t.operationName)(r),(0,t.operationName)(i.type);(0,o.invariant)(i.type===r,3)},e}(),u=function(r){function o(t){var e=t.options,i=t.context,s=t.forceUpdate,o=r.call(this,e,i)||this;return o.previousData={},o.currentObservable={},o.runLazy=!1,o.runLazyQuery=function(t){o.runLazy=!0,o.lazyOptions=t,o.forceUpdate()},o.getExecuteResult=function(){var t=o.getQueryResult();return o.startQuerySubscription(),t},o.forceUpdate=s,o}return(0,e.__extends)(o,r),o.prototype.execute=function(){this.refreshClient();var t=this.getOptions(),e=t.skip,r=t.query;return(e||r!==this.previousData.query)&&(this.removeQuerySubscription(),this.previousData.query=r),this.updateObservableQuery(),this.isMounted&&this.startQuerySubscription(),this.getExecuteSsrResult()||this.getExecuteResult()},o.prototype.executeLazy=function(){return this.runLazy?[this.runLazyQuery,this.execute()]:[this.runLazyQuery,{loading:!1,networkStatus:i.NetworkStatus.ready,called:!1,data:void 0}]},o.prototype.fetchData=function(){if(this.getOptions().skip)return!1;var t=this.getOptions(),r=(t.children,t.ssr),i=(t.displayName,t.skip,t.onCompleted,t.onError,t.partialRefetch,(0,e.__rest)(t,["children","ssr","displayName","skip","onCompleted","onError","partialRefetch"])),s=i.fetchPolicy;if(!1===r)return!1;"network-only"!==s&&"cache-and-network"!==s||(s="cache-first");var o=this.refreshClient().client.watchQuery((0,e.__assign)({},i,{fetchPolicy:s}));return this.context&&this.context.renderPromises&&this.context.renderPromises.registerSSRObservable(o,this.getOptions()),!!this.currentObservable.query.getCurrentResult().loading&&o.result()},o.prototype.afterExecute=function(t){var e=this,r=(void 0===t?{}:t).lazy,i=void 0!==r&&r;return this.isMounted=!0,i&&!this.runLazy||(this.handleErrorOrCompleted(),setTimeout(function(){e.currentObservable.query&&e.currentObservable.query.resetQueryStoreErrors()})),this.unmount.bind(this)},o.prototype.cleanup=function(){this.removeQuerySubscription(),delete this.currentObservable.query,delete this.previousData.result},o.prototype.getOptions=function(){var t=r.prototype.getOptions.call(this),i=this.lazyOptions||{},s=(0,e.__assign)({},t,{variables:(0,e.__assign)({},t.variables,i.variables),context:(0,e.__assign)({},t.context,i.context)});return this.runLazy&&delete s.skip,s},o.prototype.getExecuteSsrResult=function(){var t,e={loading:!0,networkStatus:i.NetworkStatus.loading,called:!0,data:{}};return this.context&&this.context.renderPromises&&((t=this.context.renderPromises.addQueryPromise(this,this.getExecuteResult))||(t=e)),t},o.prototype.prepareObservableQueryOptions=function(){this.verifyDocumentType(this.getOptions().query,t.DocumentType.Query);var r=this.getOptions().displayName||"Query";return(0,e.__assign)({},this.getOptions(),{displayName:r,context:this.getOptions().context||{},metadata:{reactComponent:{displayName:r}}})},o.prototype.observableQueryFields=function(t){return{variables:t.variables,refetch:t.refetch.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}},o.prototype.initializeObservableQuery=function(){if(this.context&&this.context.renderPromises&&(this.currentObservable.query=this.context.renderPromises.getSSRObservable(this.getOptions())),!this.currentObservable.query){var t=this.prepareObservableQueryOptions();this.previousData.observableQueryOptions=(0,e.__assign)({},t,{children:null}),this.currentObservable.query=this.refreshClient().client.watchQuery(t)}},o.prototype.updateObservableQuery=function(){this.currentObservable.query||this.initializeObservableQuery();var t=(0,e.__assign)({},this.prepareObservableQueryOptions(),{children:null});(0,s.equal)(t,this.previousData.observableQueryOptions)||(this.previousData.observableQueryOptions=t,this.currentObservable.query.setOptions(t).catch(function(){}))},o.prototype.startQuerySubscription=function(){var t=this;if(!this.currentObservable.subscription&&!this.getOptions().skip){var e=this.currentObservable.query;this.currentObservable.subscription=e.subscribe({next:function(e){var r=e.loading,i=e.networkStatus,o=e.data;t.previousData.result&&t.previousData.result.loading===r&&t.previousData.result.networkStatus===i&&(0,s.equal)(t.previousData.result.data,o||{})||t.forceUpdate()},error:function(e){if(t.resubscribeToQuery(),!e.hasOwnProperty("graphQLErrors"))throw e;t.forceUpdate()}})}},o.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var t=this.currentObservable.query.getLastError(),e=this.currentObservable.query.getLastResult();this.currentObservable.query.resetLastResults(),this.startQuerySubscription(),Object.assign(this.currentObservable.query,{lastError:t,lastResult:e})},o.prototype.getQueryResult=function(){var t={data:Object.create(null)};if(Object.assign(t,this.observableQueryFields(this.currentObservable.query)),this.getOptions().skip)t=(0,e.__assign)({},t,{data:void 0,error:void 0,loading:!1,called:!0});else{var r=this.currentObservable.query.getCurrentResult(),s=r.loading,o=r.partial,n=r.networkStatus,u=r.errors,a=r.error,p=r.data;if(p=p||Object.create(null),u&&u.length>0&&(a=new i.ApolloError({graphQLErrors:u})),Object.assign(t,{loading:s,networkStatus:n,error:a,called:!0}),s){var c=this.previousData.result?this.previousData.result.data:{};Object.assign(t.data,c,p)}else if(a)Object.assign(t,{data:(this.currentObservable.query.getLastResult()||{}).data});else{var l=this.currentObservable.query.options.fetchPolicy;if(this.getOptions().partialRefetch&&0===Object.keys(p).length&&o&&"cache-only"!==l)return Object.assign(t,{loading:!0,networkStatus:i.NetworkStatus.loading}),t.refetch(),t;Object.assign(t.data,p)}}return t.client=this.client,this.previousData.loading=this.previousData.result&&this.previousData.result.loading||!1,this.previousData.result=t,t},o.prototype.handleErrorOrCompleted=function(){var t=this.currentObservable.query.getCurrentResult(),e=t.data,r=t.loading,i=t.error;if(!r){var o=this.getOptions(),n=o.query,u=o.variables,a=o.onCompleted,p=o.onError;if(this.previousOptions&&!this.previousData.loading&&(0,s.equal)(this.previousOptions.query,n)&&(0,s.equal)(this.previousOptions.variables,u))return;a&&!i?a(e):p&&i&&p(i)}},o.prototype.removeQuerySubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},o}(n);function a(i,o,n){void 0===n&&(n=!1);var a=(0,r.useContext)((0,t.getApolloContext)()),p=(0,r.useReducer)(function(t){return t+1},0),c=p[0],l=p[1],h=o?(0,e.__assign)({},o,{query:i}):{query:i},b=(0,r.useRef)();b.current||(b.current=new u({options:h,context:a,forceUpdate:l}));var v=b.current;v.setOptions(h),v.context=a;var y,d,f,g=(y=function(){return n?v.executeLazy():v.execute()},d={options:h,context:a,tick:c},(f=(0,r.useRef)()).current&&(0,s.equal)(d,f.current.key)||(f.current={key:d,value:y()}),f.current.value);return(0,r.useEffect)(function(){return v.afterExecute({lazy:n})},[g]),(0,r.useEffect)(function(){return function(){return v.cleanup()}},[]),g}var p=function(r){function o(e){var i=e.options,s=e.context,o=e.result,n=e.setResult,u=r.call(this,i,s)||this;return u.runMutation=function(t){void 0===t&&(t={}),u.onMutationStart();var e=u.generateNewMutationId();return u.mutate(t).then(function(t){return u.onMutationCompleted(t,e),t}).catch(function(t){if(u.onMutationError(t,e),!u.getOptions().onError)throw t})},u.verifyDocumentType(i.mutation,t.DocumentType.Mutation),u.result=o,u.setResult=n,u.mostRecentMutationId=0,u}return(0,e.__extends)(o,r),o.prototype.execute=function(e){return this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,t.DocumentType.Mutation),[this.runMutation,e]},o.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},o.prototype.cleanup=function(){},o.prototype.mutate=function(t){var r=this.getOptions(),i=r.mutation,s=r.variables,o=r.optimisticResponse,n=r.update,u=r.context,a=void 0===u?{}:u,p=r.awaitRefetchQueries,c=void 0!==p&&p,l=r.fetchPolicy,h=(0,e.__assign)({},t),b=Object.assign({},s,h.variables);return delete h.variables,this.refreshClient().client.mutate((0,e.__assign)({mutation:i,optimisticResponse:o,refetchQueries:h.refetchQueries||this.getOptions().refetchQueries,awaitRefetchQueries:c,update:n,context:a,fetchPolicy:l,variables:b},h))},o.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},o.prototype.onMutationCompleted=function(t,e){var r=this.getOptions(),s=r.onCompleted,o=r.ignoreResults,n=t.data,u=t.errors,a=u&&u.length>0?new i.ApolloError({graphQLErrors:u}):void 0;this.isMostRecentMutation(e)&&!o&&this.updateResult({called:!0,loading:!1,data:n,error:a}),s&&s(n)},o.prototype.onMutationError=function(t,e){var r=this.getOptions().onError;this.isMostRecentMutation(e)&&this.updateResult({loading:!1,error:t,data:void 0,called:!0}),r&&r(t)},o.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},o.prototype.isMostRecentMutation=function(t){return this.mostRecentMutationId===t},o.prototype.updateResult=function(t){!this.isMounted||this.previousResult&&(0,s.equal)(this.previousResult,t)||(this.setResult(t),this.previousResult=t)},o}(n);var c=function(t){function r(e){var r=e.options,i=e.context,s=e.setResult,o=t.call(this,r,i)||this;return o.currentObservable={},o.setResult=s,o.initialize(r),o}return(0,e.__extends)(r,t),r.prototype.execute=function(t){var r=t;this.refreshClient().isNew&&(r=this.getLoadingResult());var i=this.getOptions().shouldResubscribe;return"function"==typeof i&&(i=!!i(this.getOptions())),!1!==i&&this.previousOptions&&Object.keys(this.previousOptions).length>0&&(this.previousOptions.subscription!==this.getOptions().subscription||!(0,s.equal)(this.previousOptions.variables,this.getOptions().variables))&&(this.endSubscription(),delete this.currentObservable.query,r=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),(0,e.__assign)({},r,{variables:this.getOptions().variables})},r.prototype.afterExecute=function(){this.isMounted=!0},r.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},r.prototype.initialize=function(t){this.currentObservable.query||(this.currentObservable.query=this.refreshClient().client.subscribe({query:t.subscription,variables:t.variables,fetchPolicy:t.fetchPolicy}))},r.prototype.startSubscription=function(){this.currentObservable.subscription||(this.currentObservable.subscription=this.currentObservable.query.subscribe({next:this.updateCurrentData.bind(this),error:this.updateError.bind(this),complete:this.completeSubscription.bind(this)}))},r.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},r.prototype.updateResult=function(t){this.isMounted&&this.setResult(t)},r.prototype.updateCurrentData=function(t){var e=this.getOptions().onSubscriptionData;this.updateResult({data:t.data,loading:!1,error:void 0}),e&&e({client:this.refreshClient().client,subscriptionData:t})},r.prototype.updateError=function(t){this.updateResult({error:t,loading:!1})},r.prototype.completeSubscription=function(){var t=this.getOptions().onSubscriptionComplete;t&&t(),this.endSubscription()},r.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},r}(n);var l=function(){function t(){this.queryPromises=new Map,this.queryInfoTrie=new Map}return t.prototype.registerSSRObservable=function(t,e){this.lookupQueryInfo(e).observable=t},t.prototype.getSSRObservable=function(t){return this.lookupQueryInfo(t).observable},t.prototype.addQueryPromise=function(t,e){return this.lookupQueryInfo(t.getOptions()).seen?e():(this.queryPromises.set(t.getOptions(),new Promise(function(e){e(t.fetchData())})),null)},t.prototype.hasPromises=function(){return this.queryPromises.size>0},t.prototype.consumeAndAwaitPromises=function(){var t=this,e=[];return this.queryPromises.forEach(function(r,i){t.lookupQueryInfo(i).seen=!0,e.push(r)}),this.queryPromises.clear(),Promise.all(e)},t.prototype.lookupQueryInfo=function(t){var e=this.queryInfoTrie,r=t.query,i=t.variables,s=e.get(r)||new Map;e.has(r)||e.set(r,s);var o=JSON.stringify(i),n=s.get(o)||{seen:!1,observable:null};return s.has(o)||s.set(o,n),n},t}();exports.RenderPromises=l;

@@ -121,2 +121,3 @@ import { parser, operationName, DocumentType, getApolloContext } from '@apollo/react-common';

QueryData.prototype.afterExecute = function (_a) {
var _this = this;
var _b = (_a === void 0 ? {} : _a).lazy, lazy = _b === void 0 ? false : _b;

@@ -126,2 +127,6 @@ this.isMounted = true;

this.handleErrorOrCompleted();
setTimeout(function () {
_this.currentObservable.query &&
_this.currentObservable.query.resetQueryStoreErrors();
});
}

@@ -160,7 +165,2 @@ return this.unmount.bind(this);

};
QueryData.prototype.updateCurrentData = function () {
if (this.isMounted) {
this.forceUpdate();
}
};
QueryData.prototype.prepareObservableQueryOptions = function () {

@@ -218,3 +218,3 @@ this.verifyDocumentType(this.getOptions().query, DocumentType.Query);

}
_this.updateCurrentData();
_this.forceUpdate();
},

@@ -225,3 +225,3 @@ error: function (error) {

throw error;
_this.updateCurrentData();
_this.forceUpdate();
}

@@ -242,3 +242,2 @@ });

QueryData.prototype.getQueryResult = function () {
var _this = this;
var result = {

@@ -289,5 +288,2 @@ data: Object.create(null)

}
setTimeout(function () {
_this.currentObservable.query.resetQueryStoreErrors();
});
result.client = this.client;

@@ -357,2 +353,5 @@ this.previousData.loading =

useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [result]);
useEffect(function () {
return function () { return queryData.cleanup(); };
}, []);
return result;

@@ -374,2 +373,17 @@ }

var _this = _super.call(this, options, context) || this;
_this.runMutation = function (mutationFunctionOptions) {
if (mutationFunctionOptions === void 0) { mutationFunctionOptions = {}; }
_this.onMutationStart();
var mutationId = _this.generateNewMutationId();
return _this.mutate(mutationFunctionOptions)
.then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
})
.catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError)
throw error;
});
};
_this.verifyDocumentType(options.mutation, DocumentType.Mutation);

@@ -382,7 +396,5 @@ _this.result = result;

MutationData.prototype.execute = function (result) {
var _this = this;
this.isMounted = true;
this.verifyDocumentType(this.getOptions().mutation, DocumentType.Mutation);
var runMutation = function (options) { return _this.runMutation(options); };
return [runMutation, result];
return [this.runMutation, result];
};

@@ -395,18 +407,2 @@ MutationData.prototype.afterExecute = function () {

};
MutationData.prototype.runMutation = function (mutationFunctionOptions) {
var _this = this;
if (mutationFunctionOptions === void 0) { mutationFunctionOptions = {}; }
this.onMutationStart();
var mutationId = this.generateNewMutationId();
return this.mutate(mutationFunctionOptions)
.then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
})
.catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError)
throw error;
});
};
MutationData.prototype.mutate = function (mutationFunctionOptions) {

@@ -413,0 +409,0 @@ var _a = this.getOptions(), mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, mutationContext = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy;

@@ -175,2 +175,4 @@ (function (global, factory) {

QueryData.prototype.afterExecute = function (_a) {
var _this = this;
var _b = (_a === void 0 ? {} : _a).lazy,

@@ -182,2 +184,5 @@ lazy = _b === void 0 ? false : _b;

this.handleErrorOrCompleted();
setTimeout(function () {
_this.currentObservable.query && _this.currentObservable.query.resetQueryStoreErrors();
});
}

@@ -230,8 +235,2 @@

QueryData.prototype.updateCurrentData = function () {
if (this.isMounted) {
this.forceUpdate();
}
};
QueryData.prototype.prepareObservableQueryOptions = function () {

@@ -307,3 +306,3 @@ this.verifyDocumentType(this.getOptions().query, _reactCommon.DocumentType.Query);

_this.updateCurrentData();
_this.forceUpdate();
},

@@ -315,3 +314,3 @@ error: function (error) {

_this.updateCurrentData();
_this.forceUpdate();
}

@@ -334,4 +333,2 @@ });

QueryData.prototype.getQueryResult = function () {
var _this = this;
var result = {

@@ -396,5 +393,2 @@ data: Object.create(null)

setTimeout(function () {
_this.currentObservable.query.resetQueryStoreErrors();
});
result.client = this.client;

@@ -498,2 +492,7 @@ this.previousData.loading = this.previousData.result && this.previousData.result.loading || false;

}, [result]);
(0, _react.useEffect)(function () {
return function () {
return queryData.cleanup();
};
}, []);
return result;

@@ -521,2 +520,22 @@ }

_this.runMutation = function (mutationFunctionOptions) {
if (mutationFunctionOptions === void 0) {
mutationFunctionOptions = {};
}
_this.onMutationStart();
var mutationId = _this.generateNewMutationId();
return _this.mutate(mutationFunctionOptions).then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
}).catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError) throw error;
});
};
_this.verifyDocumentType(options.mutation, _reactCommon.DocumentType.Mutation);

@@ -531,12 +550,5 @@

MutationData.prototype.execute = function (result) {
var _this = this;
this.isMounted = true;
this.verifyDocumentType(this.getOptions().mutation, _reactCommon.DocumentType.Mutation);
var runMutation = function (options) {
return _this.runMutation(options);
};
return [runMutation, result];
return [this.runMutation, result];
};

@@ -551,22 +563,2 @@

MutationData.prototype.runMutation = function (mutationFunctionOptions) {
var _this = this;
if (mutationFunctionOptions === void 0) {
mutationFunctionOptions = {};
}
this.onMutationStart();
var mutationId = this.generateNewMutationId();
return this.mutate(mutationFunctionOptions).then(function (response) {
_this.onMutationCompleted(response, mutationId);
return response;
}).catch(function (error) {
_this.onMutationError(error, mutationId);
if (!_this.getOptions().onError) throw error;
});
};
MutationData.prototype.mutate = function (mutationFunctionOptions) {

@@ -573,0 +565,0 @@ var _a = this.getOptions(),

@@ -29,4 +29,7 @@ import * as tslib_1 from "tslib";

useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [result]);
useEffect(function () {
return function () { return queryData.cleanup(); };
}, []);
return result;
}
//# sourceMappingURL=useBaseQuery.js.map
{
"name": "@apollo/react-hooks",
"description": "React Apollo Hooks.",
"version": "0.1.0-beta.11",
"version": "0.1.0-beta.12",
"author": "opensource@apollographql.com",

@@ -45,3 +45,3 @@ "keywords": [

"dependencies": {
"@apollo/react-common": "^0.1.0-beta.9",
"@apollo/react-common": "^0.1.0-beta.10",
"@wry/equality": "^0.1.9",

@@ -59,7 +59,7 @@ "ts-invariant": "^0.4.4",

"jest": "24.8.0",
"rollup": "1.16.7",
"rollup": "1.18.0",
"tsc-watch": "2.2.1",
"typescript": "3.5.3"
},
"gitHead": "bd87da901113c81e3e7e2a7edaeac791895abb96"
"gitHead": "38567ea3c2ecb49f4c6937a1a1fb3caf32f3a5a0"
}

@@ -145,3 +145,3 @@ # <a href="https://www.apollographql.com/"><img src="https://user-images.githubusercontent.com/841294/53402609-b97a2180-39ba-11e9-8100-812bab86357c.png" height="100" alt="React Apollo"></a>

variables?: TVariables;
optimisticResponse?: TData;
optimisticResponse?: TData | ((vars: TVariables) => TData);
refetchQueries?: Array<string | PureQueryOptions> | RefetchQueriesFunction;

@@ -148,0 +148,0 @@ awaitRefetchQueries?: boolean;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc