@urql/core
Advanced tools
Comparing version 1.12.2 to 1.12.3
# @urql/core | ||
## 1.12.3 | ||
### Patch Changes | ||
- Remove whitespace and comments from string-queries, by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#911](https://github.com/FormidableLabs/urql/pull/911)) | ||
- Remove redundant whitespaces when using GET for graphql queries, by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#908](https://github.com/FormidableLabs/urql/pull/908)) | ||
## 1.12.2 | ||
@@ -4,0 +11,0 @@ |
"use strict"; | ||
var fetchSource = require("./838e26bf.js"); | ||
var fetchSource = require("./2cc5ffbc.js"); | ||
@@ -5,0 +5,0 @@ exports.makeFetchBody = fetchSource.makeFetchBody; |
@@ -1,2 +0,2 @@ | ||
"use strict";var e=require("./9f3d5971.min.js");exports.makeFetchBody=e.makeFetchBody,exports.makeFetchOptions=e.makeFetchOptions,exports.makeFetchSource=e.makeFetchSource,exports.makeFetchURL=e.makeFetchURL; | ||
"use strict";var e=require("./f33764e8.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 |
@@ -71,3 +71,3 @@ "use strict"; | ||
var fetchSource = require("./838e26bf.js"), wonka = require("wonka"), parser = require("graphql/language/parser"), printer = require("graphql/language/printer"), kinds = require("graphql/language/kinds"), visitor = require("graphql/language/visitor"), phash = function(a, b) { | ||
var fetchSource = require("./2cc5ffbc.js"), wonka = require("wonka"), parser = require("graphql/language/parser"), printer = require("graphql/language/printer"), kinds = require("graphql/language/kinds"), visitor = require("graphql/language/visitor"), phash = function(a, b) { | ||
a |= 0; | ||
@@ -81,7 +81,9 @@ for (var c = 0, d = 0 | b.length; c < d; c++) { | ||
}, hashQuery = function(a) { | ||
return hash(a.replace(/[\s,]+/g, " ").trim()); | ||
return hash(a.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim()); | ||
}, docs = Object.create(null), createRequest = function(a, b) { | ||
if ("string" == typeof a) { | ||
var c = hashQuery(a); | ||
a = void 0 !== docs[c] ? docs[c] : parser.parse(a); | ||
a = void 0 !== docs[c] ? docs[c] : parser.parse(a, { | ||
noLocation: !0 | ||
}); | ||
} else { | ||
@@ -88,0 +90,0 @@ void 0 !== a.__key ? c = a.__key : (c = hashQuery(printer.print(a)), a = void 0 !== docs[c] ? docs[c] : a); |
@@ -1,2 +0,2 @@ | ||
"use strict";var e=require("./9f3d5971.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,]+/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)}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 Q=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 L(){return!1}var D=function(e){function r(e){}return function(e){return t.filter(L)(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,Q],$=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.fallbackExchangeIO=F,exports.fetchExchange=Q,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.data,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: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("./f33764e8.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){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.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.data,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: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.12.2", | ||
"version": "1.12.3", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
296978
2050