Socket
Socket
Sign inDemoInstall

@urql/core

Package Overview
Dependencies
Maintainers
33
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@urql/core - npm Package Compare versions

Comparing version 1.13.0 to 1.13.1

6

CHANGELOG.md
# @urql/core
## 1.13.1
### Patch Changes
- Allow `client.reexecuteOperation` to be called with mutations which skip the active operation minimums, by [@kitten](https://github.com/kitten) (See [#1011](https://github.com/FormidableLabs/urql/pull/1011))
## 1.13.0

@@ -4,0 +10,0 @@

4

dist/urql-core.js

@@ -555,3 +555,5 @@ "use strict";

this.reexecuteOperation = function(a) {
0 < (c.activeOperations[a.key] || 0) && (c.queue.push(a), k || Promise.resolve().then(c.dispatchOperation));
if ("mutation" === a.operationName || 0 < (c.activeOperations[a.key] || 0)) {
c.queue.push(a), k || Promise.resolve().then(c.dispatchOperation);
}
};

@@ -558,0 +560,0 @@ a = composeExchanges(void 0 !== a.exchanges ? a.exchanges : defaultExchanges);

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

"use strict";var e=require("./d07b2549.min.js"),t=require("wonka"),r=require("graphql/language/parser"),n=require("graphql/language/printer"),o=require("graphql/language/kinds"),i=require("graphql/language/visitor"),a=function(e,t){e|=0;for(var r=0,n=0|t.length;r<n;r++)e=(e<<5)+e+t.charCodeAt(r);return e},u=function(e){return function(e){return a(5381,e)>>>0}(e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim())},c=Object.create(null),s=function(t,o){if("string"==typeof t){var i=u(t);t=void 0!==c[i]?c[i]:r.parse(t,{noLocation:!0})}else void 0!==t.__key?i=t.__key:(i=u(n.print(t)),t=void 0!==c[i]?c[i]:t);return c[i]=t,t.__key=i,{key:o?a(i,e.stringifyVariables(o))>>>0:i,query:t,variables:o||{}}},p=function(t,r){return e._extends({},t,{context:e._extends({},t.context,{meta:e._extends({},t.context.meta,r)})})},f=function(e,t){if(void 0===t&&(t=[]),Array.isArray(e))e.forEach((function(e){f(e,t)}));else if("object"==typeof e&&null!==e)for(var r in e)"__typename"===r&&"string"==typeof e[r]?t.push(e[r]):f(e[r],t);return t};function l(e,t,r){return r.indexOf(e)===t}var h=function(e){return f(e).filter(l)};function d(e){return e.kind===o.Kind.FIELD&&"__typename"===e.name.value}var y=function(t){if(t.selectionSet&&!t.selectionSet.selections.some(d))return e._extends({},t,{selectionSet:e._extends({},t.selectionSet,{selections:t.selectionSet.selections.concat([{kind:o.Kind.FIELD,name:{kind:o.Kind.NAME,value:"__typename"}}])})})},m=function(e){var t=i.visit(e,{Field:y,InlineFragment:y});return t.__key=e.__key,t},v=function(e){return e&&"object"==typeof e?Object.keys(e).reduce((function(t,r){var n=e[r];return"__typename"===r?Object.defineProperty(t,"__typename",{enumerable:!1,value:n}):t[r]=Array.isArray(n)?n.map(v):n&&"object"==typeof n&&"__typename"in n?v(n):n,t}),{}):e};function x(e){return e.toPromise=function(){return t.toPromise(t.take(1)(e))},e}var k=function(){},g=function(e){return"subscription"!==(e=e.operationName)&&"query"!==e};function q(e){return e.path||e.extensions?{message:e.message,path:e.path,extensions:e.extensions}:e.message}var b=function(e){return"mutation"!==(e=e.operationName)&&"query"!==e};function O(t){return e._extends({},t,{query:m(t.query)})}function E(e){return"query"!==e.operationName||"cache-only"!==e.context.requestPolicy}function _(e){return p(e,{cacheOutcome:"miss"})}function w(e){return b(e)}var N=function(r){function n(t){var r=s.get(t.key);return r=e._extends({},r,{operation:p(t,{cacheOutcome:r?"hit":"miss"})}),"cache-and-network"===t.context.requestPolicy&&(r.stale=!0,S(c,t)),r}function o(e){return!b(e)&&d(e)}function i(e){e.operation&&"mutation"===e.operation.operationName?l(e):e.operation&&"query"===e.operation.operationName&&h(e)}function a(e){return!b(e)&&!d(e)}var u=r.forward,c=r.client,s=new Map;r=Object.create(null);var f=O,l=P(s,r,c),h=R(s,r),d=function(e){var t=e.context.requestPolicy;return"query"===e.operationName&&"network-only"!==t&&("cache-only"===t||s.has(e.key))};return function(e){var r=t.share(e);return e=t.map(n)(t.filter(o)(r)),r=t.tap(i)(u(t.filter(E)(t.map(_)(t.merge([t.map(f)(t.filter(a)(r)),t.filter(w)(r)]))))),t.merge([e,r])}},S=function(t,r){return t.reexecuteOperation(e._extends({},r,{context:e._extends({},r.context,{requestPolicy:"network-only"})}))},P=function(e,t,r,n){function o(t){if(e.has(t)){var n=e.get(t).operation;e.delete(t),S(r,n)}}return function(e){function r(e){n.add(e)}var n=new Set,i=e.operation.context.additionalTypenames;h(e.data).concat(i||[]).forEach((function(e){(e=t[e]||(t[e]=new Set)).forEach(r),e.clear()})),n.forEach(o)}},R=function(e,t){return function(r){var n=r.operation,o=r.data,i=n.context.additionalTypenames;null!=o&&(e.set(n.key,{operation:n,data:o,error:r.error}),h(r.data).concat(i||[]).forEach((function(e){(t[e]||(t[e]=new Set)).add(n.key)})))}},M=function(e){var r=e.forward,n=new Set,o=function(e){var t=e.key;return"teardown"===(e=e.operationName)?(n.delete(t),!0):"query"!==e&&"subscription"!==e||(e=n.has(t),n.add(t),!e)},i=function(e){n.delete(e.operation.key)};return function(e){return e=t.filter(o)(e),t.tap(i)(r(e))}};function j(e){return"query"===e.operationName||"mutation"===e.operationName}function C(e){return"query"!==e.operationName&&"mutation"!==e.operationName}var L=function(r){var n=r.forward;return function(r){var o=t.share(r);r=t.mergeMap((function(r){var n=r.key,i=t.filter((function(e){return"teardown"===e.operationName&&e.key===n}))(o),a=e.makeFetchBody(r),u=e.makeFetchURL(r,a);return a=e.makeFetchOptions(r,a),t.onPush((function(e){}))(t.takeUntil(i)(e.makeFetchSource(r,u,a)))}))(t.filter(j)(o));var i=n(t.filter(C)(o));return t.merge([r,i])}};function Q(){return!1}var D=function(e){function r(e){}return function(e){return t.filter(Q)(t.tap(r)(e))}},F=D(),A=function(e){return function(t){var r=t.client;return e.reduceRight((function(e,t){return t({client:r,forward:e,dispatchDebug:function(e){}})}),t.forward)}},T=[M,N,L],$=function(r){var n=this;this.activeOperations=Object.create(null),this.queue=[],this.createOperationContext=function(t){return e._extends({},{url:n.url,fetchOptions:n.fetchOptions,fetch:n.fetch,preferGetMethod:n.preferGetMethod},t,{requestPolicy:(t||{}).requestPolicy||n.requestPolicy})},this.createRequestOperation=function(e,t,r){return{key:t.key,query:t.query,variables:t.variables,operationName:e,context:n.createOperationContext(r)}},this.executeQuery=function(e,r){e=n.createRequestOperation("query",e,r);var o=n.executeRequestOperation(e);return(e=e.context.pollInterval)?t.switchMap((function(){return o}))(t.merge([t.fromValue(0),t.interval(e)])):o},this.executeSubscription=function(e,t){return e=n.createRequestOperation("subscription",e,t),n.executeRequestOperation(e)},this.executeMutation=function(e,t){return e=n.createRequestOperation("mutation",e,t),n.executeRequestOperation(e)};var o=k;this.url=r.url,this.fetchOptions=r.fetchOptions,this.fetch=r.fetch,this.suspense=!!r.suspense,this.requestPolicy=r.requestPolicy||"cache-first",this.preferGetMethod=!!r.preferGetMethod,this.maskTypename=!!r.maskTypename;var i=t.makeSubject(),a=i.next;this.operations$=i.source;var u=!1;this.dispatchOperation=function(e){for(u=!0,e&&a(e);e=n.queue.shift();)a(e);u=!1},this.reexecuteOperation=function(e){0<(n.activeOperations[e.key]||0)&&(n.queue.push(e),u||Promise.resolve().then(n.dispatchOperation))},r=A(void 0!==r.exchanges?r.exchanges:T),this.results$=t.share(r({client:this,dispatchDebug:o,forward:D()})(this.operations$)),t.publish(this.results$)};function I(e){return e.data=v(e.data),e}$.prototype.onOperationStart=function(e){var t=e.key;this.activeOperations[t]=(this.activeOperations[t]||0)+1,this.dispatchOperation(e)},$.prototype.onOperationEnd=function(t){var r=t.key,n=this.activeOperations[r]||0;0>=(this.activeOperations[r]=0>=n?0:n-1)&&this.dispatchOperation(e._extends({},t,{operationName:"teardown"}))},$.prototype.executeRequestOperation=function(e){var r=this,n=e.key,o=e.operationName,i=t.filter((function(e){return e.operation.key===n}))(this.results$);if(this.maskTypename&&(i=t.map(I)(i)),"mutation"===o)return t.take(1)(t.onStart((function(){return r.dispatchOperation(e)}))(i));var a=t.filter((function(e){return"teardown"===e.operationName&&e.key===n}))(this.operations$);return i=t.onEnd((function(){r.onOperationEnd(e)}))(t.onStart((function(){r.onOperationStart(e)}))(t.takeUntil(a)(i))),!1!==e.context.suspense&&this.suspense&&"query"===o?function(e){return function(r){var n=t.share(e),o=!1,i=!1;if(t.onPush((function(){return o=!0}))(t.takeWhile((function(){return!i}))(n))(r),!o)throw i=!0,r(0),t.toPromise(t.take(1)(n))}}(i):i},$.prototype.query=function(t,r,n){return n&&"boolean"==typeof n.suspense||(n=e._extends({},n,{suspense:!1})),x(this.executeQuery(s(t,r),n))},$.prototype.readQuery=function(e,r,n){var o=null;return t.subscribe((function(e){o=e}))(this.executeQuery(s(e,r),n)).unsubscribe(),o},$.prototype.subscription=function(e,t,r){return this.executeSubscription(s(e,t),r)},$.prototype.mutation=function(e,t,r){return x(this.executeMutation(s(e,t),r))},exports.CombinedError=e.CombinedError,exports.makeErrorResult=e.makeErrorResult,exports.makeResult=e.makeResult,exports.stringifyVariables=e.stringifyVariables,exports.Client=$,exports.cacheExchange=N,exports.composeExchanges=A,exports.createClient=function(e){return new $(e)},exports.createRequest=s,exports.debugExchange=function(e){var t=e.forward;return function(e){return t(e)}},exports.dedupExchange=M,exports.defaultExchanges=T,exports.errorExchange=function(e){function r(e){var t=e.error;e=e.operation,t&&n(t,e)}var n=e.onError;return function(e){var n=e.forward;return function(e){return t.tap(r)(n(e))}}},exports.fallbackExchangeIO=F,exports.fetchExchange=L,exports.formatDocument=m,exports.maskTypename=v,exports.ssrExchange=function(r){function n(){for(var e;e=s.shift();)delete c[e]}function o(e){return!f(e)}function i(t){return function(t,r){var n=r.error;return{operation:t,data:(r=r.data)?JSON.parse(r):void 0,extensions:void 0,error:n?new e.CombinedError({networkError:n.networkError?Error(n.networkError):void 0,graphQLErrors:n.graphQLErrors&&n.graphQLErrors.length?n.graphQLErrors:void 0}):void 0}}(t,c[t.key])}function a(e){return f(e)}function u(e){var t=e.operation;g(t)||(e=function(e){var t=e.error;return e={data:JSON.stringify(e.data),error:void 0},t&&(e.error={graphQLErrors:t.graphQLErrors.map(q),networkError:t.networkError?""+t.networkError:void 0}),e}(e),c[t.key]=e)}var c={},s=[],p=function(e){s.push(e.operation.key),1===s.length&&Promise.resolve().then(n)},f=function(e){return!g(e)&&void 0!==c[e.key]},l=function(e){var n=e.client,c=e.forward;return function(e){var s=r&&"boolean"==typeof r.isClient?!!r.isClient:!n.suspense,f=t.share(e);return e=c(t.filter(o)(f)),f=t.map(i)(t.filter(a)(f)),s?f=t.tap(p)(f):e=t.tap(u)(e),t.merge([e,f])}};return l.restoreData=function(t){return e._extends(c,t)},l.extractData=function(){return e._extends({},c)},r&&r.initialState&&l.restoreData(r.initialState),l},exports.subscriptionExchange=function(r){function o(e){return"subscription"===(e=e.operationName)||!!a&&("query"===e||"mutation"===e)}var i=r.forwardSubscription,a=r.enableAllOperations;return function(r){function a(e){return!p(e)}var u=r.client,c=r.forward,s=function(r){var o=i({key:r.key.toString(36),query:n.print(r.query),variables:r.variables,context:e._extends({},r.context)});return t.make((function(t){function n(t){return s(e.makeResult(r,t))}function i(t){return s(e.makeErrorResult(r,t))}function a(){f||(f=!0,"subscription"===r.operationName&&u.reexecuteOperation(e._extends({},r,{operationName:"teardown"})),p())}var c,s=t.next,p=t.complete,f=!1;return Promise.resolve().then((function(){f||(c=o.subscribe({next:n,error:i,complete:a}))})),function(){f=!0,c&&c.unsubscribe()}}))},p=o;return function(e){var r=t.share(e);e=t.mergeMap((function(e){var n=e.key,o=t.filter((function(e){return"teardown"===e.operationName&&e.key===n}))(r);return t.takeUntil(o)(s(e))}))(t.filter(p)(r));var n=c(t.filter(a)(r));return t.merge([e,n])}}};
"use strict";var e=require("./d07b2549.min.js"),t=require("wonka"),r=require("graphql/language/parser"),n=require("graphql/language/printer"),o=require("graphql/language/kinds"),i=require("graphql/language/visitor"),a=function(e,t){e|=0;for(var r=0,n=0|t.length;r<n;r++)e=(e<<5)+e+t.charCodeAt(r);return e},u=function(e){return function(e){return a(5381,e)>>>0}(e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim())},c=Object.create(null),s=function(t,o){if("string"==typeof t){var i=u(t);t=void 0!==c[i]?c[i]:r.parse(t,{noLocation:!0})}else void 0!==t.__key?i=t.__key:(i=u(n.print(t)),t=void 0!==c[i]?c[i]:t);return c[i]=t,t.__key=i,{key:o?a(i,e.stringifyVariables(o))>>>0:i,query:t,variables:o||{}}},p=function(t,r){return e._extends({},t,{context:e._extends({},t.context,{meta:e._extends({},t.context.meta,r)})})},f=function(e,t){if(void 0===t&&(t=[]),Array.isArray(e))e.forEach((function(e){f(e,t)}));else if("object"==typeof e&&null!==e)for(var r in e)"__typename"===r&&"string"==typeof e[r]?t.push(e[r]):f(e[r],t);return t};function l(e,t,r){return r.indexOf(e)===t}var h=function(e){return f(e).filter(l)};function d(e){return e.kind===o.Kind.FIELD&&"__typename"===e.name.value}var m=function(t){if(t.selectionSet&&!t.selectionSet.selections.some(d))return e._extends({},t,{selectionSet:e._extends({},t.selectionSet,{selections:t.selectionSet.selections.concat([{kind:o.Kind.FIELD,name:{kind:o.Kind.NAME,value:"__typename"}}])})})},y=function(e){var t=i.visit(e,{Field:m,InlineFragment:m});return t.__key=e.__key,t},v=function(e){return e&&"object"==typeof e?Object.keys(e).reduce((function(t,r){var n=e[r];return"__typename"===r?Object.defineProperty(t,"__typename",{enumerable:!1,value:n}):t[r]=Array.isArray(n)?n.map(v):n&&"object"==typeof n&&"__typename"in n?v(n):n,t}),{}):e};function x(e){return e.toPromise=function(){return t.toPromise(t.take(1)(e))},e}var k=function(){},g=function(e){return"subscription"!==(e=e.operationName)&&"query"!==e};function q(e){return e.path||e.extensions?{message:e.message,path:e.path,extensions:e.extensions}:e.message}var b=function(e){return"mutation"!==(e=e.operationName)&&"query"!==e};function O(t){return e._extends({},t,{query:y(t.query)})}function E(e){return"query"!==e.operationName||"cache-only"!==e.context.requestPolicy}function _(e){return p(e,{cacheOutcome:"miss"})}function w(e){return b(e)}var N=function(r){function n(t){var r=s.get(t.key);return r=e._extends({},r,{operation:p(t,{cacheOutcome:r?"hit":"miss"})}),"cache-and-network"===t.context.requestPolicy&&(r.stale=!0,S(c,t)),r}function o(e){return!b(e)&&d(e)}function i(e){e.operation&&"mutation"===e.operation.operationName?l(e):e.operation&&"query"===e.operation.operationName&&h(e)}function a(e){return!b(e)&&!d(e)}var u=r.forward,c=r.client,s=new Map;r=Object.create(null);var f=O,l=P(s,r,c),h=R(s,r),d=function(e){var t=e.context.requestPolicy;return"query"===e.operationName&&"network-only"!==t&&("cache-only"===t||s.has(e.key))};return function(e){var r=t.share(e);return e=t.map(n)(t.filter(o)(r)),r=t.tap(i)(u(t.filter(E)(t.map(_)(t.merge([t.map(f)(t.filter(a)(r)),t.filter(w)(r)]))))),t.merge([e,r])}},S=function(t,r){return t.reexecuteOperation(e._extends({},r,{context:e._extends({},r.context,{requestPolicy:"network-only"})}))},P=function(e,t,r,n){function o(t){if(e.has(t)){var n=e.get(t).operation;e.delete(t),S(r,n)}}return function(e){function r(e){n.add(e)}var n=new Set,i=e.operation.context.additionalTypenames;h(e.data).concat(i||[]).forEach((function(e){(e=t[e]||(t[e]=new Set)).forEach(r),e.clear()})),n.forEach(o)}},R=function(e,t){return function(r){var n=r.operation,o=r.data,i=n.context.additionalTypenames;null!=o&&(e.set(n.key,{operation:n,data:o,error:r.error}),h(r.data).concat(i||[]).forEach((function(e){(t[e]||(t[e]=new Set)).add(n.key)})))}},M=function(e){var r=e.forward,n=new Set,o=function(e){var t=e.key;return"teardown"===(e=e.operationName)?(n.delete(t),!0):"query"!==e&&"subscription"!==e||(e=n.has(t),n.add(t),!e)},i=function(e){n.delete(e.operation.key)};return function(e){return e=t.filter(o)(e),t.tap(i)(r(e))}};function j(e){return"query"===e.operationName||"mutation"===e.operationName}function C(e){return"query"!==e.operationName&&"mutation"!==e.operationName}var L=function(r){var n=r.forward;return function(r){var o=t.share(r);r=t.mergeMap((function(r){var n=r.key,i=t.filter((function(e){return"teardown"===e.operationName&&e.key===n}))(o),a=e.makeFetchBody(r),u=e.makeFetchURL(r,a);return a=e.makeFetchOptions(r,a),t.onPush((function(e){}))(t.takeUntil(i)(e.makeFetchSource(r,u,a)))}))(t.filter(j)(o));var i=n(t.filter(C)(o));return t.merge([r,i])}};function Q(){return!1}var D=function(e){function r(e){}return function(e){return t.filter(Q)(t.tap(r)(e))}},F=D(),A=function(e){return function(t){var r=t.client;return e.reduceRight((function(e,t){return t({client:r,forward:e,dispatchDebug:function(e){}})}),t.forward)}},T=[M,N,L],$=function(r){var n=this;this.activeOperations=Object.create(null),this.queue=[],this.createOperationContext=function(t){return e._extends({},{url:n.url,fetchOptions:n.fetchOptions,fetch:n.fetch,preferGetMethod:n.preferGetMethod},t,{requestPolicy:(t||{}).requestPolicy||n.requestPolicy})},this.createRequestOperation=function(e,t,r){return{key:t.key,query:t.query,variables:t.variables,operationName:e,context:n.createOperationContext(r)}},this.executeQuery=function(e,r){e=n.createRequestOperation("query",e,r);var o=n.executeRequestOperation(e);return(e=e.context.pollInterval)?t.switchMap((function(){return o}))(t.merge([t.fromValue(0),t.interval(e)])):o},this.executeSubscription=function(e,t){return e=n.createRequestOperation("subscription",e,t),n.executeRequestOperation(e)},this.executeMutation=function(e,t){return e=n.createRequestOperation("mutation",e,t),n.executeRequestOperation(e)};var o=k;this.url=r.url,this.fetchOptions=r.fetchOptions,this.fetch=r.fetch,this.suspense=!!r.suspense,this.requestPolicy=r.requestPolicy||"cache-first",this.preferGetMethod=!!r.preferGetMethod,this.maskTypename=!!r.maskTypename;var i=t.makeSubject(),a=i.next;this.operations$=i.source;var u=!1;this.dispatchOperation=function(e){for(u=!0,e&&a(e);e=n.queue.shift();)a(e);u=!1},this.reexecuteOperation=function(e){("mutation"===e.operationName||0<(n.activeOperations[e.key]||0))&&(n.queue.push(e),u||Promise.resolve().then(n.dispatchOperation))},r=A(void 0!==r.exchanges?r.exchanges:T),this.results$=t.share(r({client:this,dispatchDebug:o,forward:D()})(this.operations$)),t.publish(this.results$)};function I(e){return e.data=v(e.data),e}$.prototype.onOperationStart=function(e){var t=e.key;this.activeOperations[t]=(this.activeOperations[t]||0)+1,this.dispatchOperation(e)},$.prototype.onOperationEnd=function(t){var r=t.key,n=this.activeOperations[r]||0;0>=(this.activeOperations[r]=0>=n?0:n-1)&&this.dispatchOperation(e._extends({},t,{operationName:"teardown"}))},$.prototype.executeRequestOperation=function(e){var r=this,n=e.key,o=e.operationName,i=t.filter((function(e){return e.operation.key===n}))(this.results$);if(this.maskTypename&&(i=t.map(I)(i)),"mutation"===o)return t.take(1)(t.onStart((function(){return r.dispatchOperation(e)}))(i));var a=t.filter((function(e){return"teardown"===e.operationName&&e.key===n}))(this.operations$);return i=t.onEnd((function(){r.onOperationEnd(e)}))(t.onStart((function(){r.onOperationStart(e)}))(t.takeUntil(a)(i))),!1!==e.context.suspense&&this.suspense&&"query"===o?function(e){return function(r){var n=t.share(e),o=!1,i=!1;if(t.onPush((function(){return o=!0}))(t.takeWhile((function(){return!i}))(n))(r),!o)throw i=!0,r(0),t.toPromise(t.take(1)(n))}}(i):i},$.prototype.query=function(t,r,n){return n&&"boolean"==typeof n.suspense||(n=e._extends({},n,{suspense:!1})),x(this.executeQuery(s(t,r),n))},$.prototype.readQuery=function(e,r,n){var o=null;return t.subscribe((function(e){o=e}))(this.executeQuery(s(e,r),n)).unsubscribe(),o},$.prototype.subscription=function(e,t,r){return this.executeSubscription(s(e,t),r)},$.prototype.mutation=function(e,t,r){return x(this.executeMutation(s(e,t),r))},exports.CombinedError=e.CombinedError,exports.makeErrorResult=e.makeErrorResult,exports.makeResult=e.makeResult,exports.stringifyVariables=e.stringifyVariables,exports.Client=$,exports.cacheExchange=N,exports.composeExchanges=A,exports.createClient=function(e){return new $(e)},exports.createRequest=s,exports.debugExchange=function(e){var t=e.forward;return function(e){return t(e)}},exports.dedupExchange=M,exports.defaultExchanges=T,exports.errorExchange=function(e){function r(e){var t=e.error;e=e.operation,t&&n(t,e)}var n=e.onError;return function(e){var n=e.forward;return function(e){return t.tap(r)(n(e))}}},exports.fallbackExchangeIO=F,exports.fetchExchange=L,exports.formatDocument=y,exports.maskTypename=v,exports.ssrExchange=function(r){function n(){for(var e;e=s.shift();)delete c[e]}function o(e){return!f(e)}function i(t){return function(t,r){var n=r.error;return{operation:t,data:(r=r.data)?JSON.parse(r):void 0,extensions:void 0,error:n?new e.CombinedError({networkError:n.networkError?Error(n.networkError):void 0,graphQLErrors:n.graphQLErrors&&n.graphQLErrors.length?n.graphQLErrors:void 0}):void 0}}(t,c[t.key])}function a(e){return f(e)}function u(e){var t=e.operation;g(t)||(e=function(e){var t=e.error;return e={data:JSON.stringify(e.data),error:void 0},t&&(e.error={graphQLErrors:t.graphQLErrors.map(q),networkError:t.networkError?""+t.networkError:void 0}),e}(e),c[t.key]=e)}var c={},s=[],p=function(e){s.push(e.operation.key),1===s.length&&Promise.resolve().then(n)},f=function(e){return!g(e)&&void 0!==c[e.key]},l=function(e){var n=e.client,c=e.forward;return function(e){var s=r&&"boolean"==typeof r.isClient?!!r.isClient:!n.suspense,f=t.share(e);return e=c(t.filter(o)(f)),f=t.map(i)(t.filter(a)(f)),s?f=t.tap(p)(f):e=t.tap(u)(e),t.merge([e,f])}};return l.restoreData=function(t){return e._extends(c,t)},l.extractData=function(){return e._extends({},c)},r&&r.initialState&&l.restoreData(r.initialState),l},exports.subscriptionExchange=function(r){function o(e){return"subscription"===(e=e.operationName)||!!a&&("query"===e||"mutation"===e)}var i=r.forwardSubscription,a=r.enableAllOperations;return function(r){function a(e){return!p(e)}var u=r.client,c=r.forward,s=function(r){var o=i({key:r.key.toString(36),query:n.print(r.query),variables:r.variables,context:e._extends({},r.context)});return t.make((function(t){function n(t){return s(e.makeResult(r,t))}function i(t){return s(e.makeErrorResult(r,t))}function a(){f||(f=!0,"subscription"===r.operationName&&u.reexecuteOperation(e._extends({},r,{operationName:"teardown"})),p())}var c,s=t.next,p=t.complete,f=!1;return Promise.resolve().then((function(){f||(c=o.subscribe({next:n,error:i,complete:a}))})),function(){f=!0,c&&c.unsubscribe()}}))},p=o;return function(e){var r=t.share(e);e=t.mergeMap((function(e){var n=e.key,o=t.filter((function(e){return"teardown"===e.operationName&&e.key===n}))(r);return t.takeUntil(o)(s(e))}))(t.filter(p)(r));var n=c(t.filter(a)(r));return t.merge([e,n])}}};
//# sourceMappingURL=urql-core.min.js.map
{
"name": "@urql/core",
"version": "1.13.0",
"version": "1.13.1",
"description": "The shared core for the highly customizable and versatile GraphQL client",

@@ -5,0 +5,0 @@ "sideEffects": false,

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

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc