Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@urql/core

Package Overview
Dependencies
Maintainers
30
Versions
263
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.16.1 to 1.16.2

dist/11660200.min.js

6

CHANGELOG.md
# @urql/core
## 1.16.2
### Patch Changes
- Add a workaround for `graphql-tag/loader`, which provides filtered query documents (where the original document contains multiple operations) without updating or providing a correct `document.loc.source.body` string, by [@kitten](https://github.com/kitten) (See [#1315](https://github.com/FormidableLabs/urql/pull/1315))
## 1.16.1

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

2

dist/urql-core-internal.js
"use strict";
var fetchSource = require("./2cbb0ff5.js");
var fetchSource = require("./408a05a6.js");

@@ -5,0 +5,0 @@ exports.makeFetchBody = fetchSource.makeFetchBody;

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

"use strict";var e=require("./b3f27070.min.js");exports.makeFetchBody=e.makeFetchBody,exports.makeFetchOptions=e.makeFetchOptions,exports.makeFetchSource=e.makeFetchSource,exports.makeFetchURL=e.makeFetchURL;
"use strict";var e=require("./11660200.min.js");exports.makeFetchBody=e.makeFetchBody,exports.makeFetchOptions=e.makeFetchOptions,exports.makeFetchSource=e.makeFetchSource,exports.makeFetchURL=e.makeFetchURL;
//# sourceMappingURL=urql-core-internal.min.js.map

@@ -82,3 +82,3 @@ "use strict";

var graphql = require("graphql"), fetchSource = require("./2cbb0ff5.js"), wonka = require("wonka"), collectTypes = function(a, b) {
var graphql = require("graphql"), fetchSource = require("./408a05a6.js"), wonka = require("wonka"), collectTypes = function(a, b) {
if (Array.isArray(a)) {

@@ -85,0 +85,0 @@ for (var c = 0; c < a.length; c++) {

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

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

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