Socket
Socket
Sign inDemoInstall

@urql/exchange-graphcache

Package Overview
Dependencies
Maintainers
31
Versions
294
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@urql/exchange-graphcache - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

10

CHANGELOG.md
# @urql/exchange-graphcache
## 2.3.2
### Patch Changes
- Pick modules from graphql package, instead of importing from graphql/index.mjs, by [@kitten](https://github.com/kitten) (See [#700](https://github.com/FormidableLabs/urql/pull/700))
- Change invalidation to check for undefined links since null is a valid value in graphql, by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#694](https://github.com/FormidableLabs/urql/pull/694))
- Updated dependencies (See [#700](https://github.com/FormidableLabs/urql/pull/700))
- @urql/exchange-populate@0.1.5
- @urql/core@1.10.9
## 2.3.1

@@ -4,0 +14,0 @@

34

dist/urql-exchange-graphcache.js
"use strict";
var _rollupPluginBabelHelpers = require("./7832a774.js"), graphql = require("graphql"), core = require("@urql/core"), wonka = require("wonka"), exchangePopulate = require("@urql/exchange-populate"), getName = function(a) {
var _rollupPluginBabelHelpers = require("./7832a774.js"), valueFromASTUntyped = require("graphql/utilities/valueFromASTUntyped"), kinds = require("graphql/language/kinds"), definition = require("graphql/type/definition"), core = require("@urql/core"), buildClientSchema = require("graphql/utilities/buildClientSchema"), wonka = require("wonka"), exchangePopulate = require("@urql/exchange-populate"), getName = function(a) {
return a.name.value;

@@ -14,5 +14,5 @@ }, getFragmentTypeName = function(a) {

}, isFieldNode = function(a) {
return a.kind === graphql.Kind.FIELD;
return a.kind === kinds.Kind.FIELD;
}, isInlineFragment = function(a) {
return a.kind === graphql.Kind.INLINE_FRAGMENT;
return a.kind === kinds.Kind.INLINE_FRAGMENT;
}, getFieldArguments = function(a, b) {

@@ -22,3 +22,3 @@ var c = {}, e = 0;

for (var d = 0, f = a.arguments.length; d < f; d++) {
var g = a.arguments[d], h = graphql.valueFromASTUntyped(g.value, b);
var g = a.arguments[d], h = valueFromASTUntyped.valueFromASTUntyped(g.value, b);
null != h && (c[getName(g)] = h, e++);

@@ -44,3 +44,3 @@ }

var f = a.variableDefinitions[e], g = getName(f.variable);
c[g] = void 0 === b[g] && f.defaultValue ? graphql.valueFromASTUntyped(f.defaultValue, b) : b[g];
c[g] = void 0 === b[g] && f.defaultValue ? valueFromASTUntyped.valueFromASTUntyped(f.defaultValue, b) : b[g];
}

@@ -54,3 +54,3 @@ }

var c = "";
b.kind === graphql.Kind.INLINE_FRAGMENT ? c = a ? 'Inline Fragment on "' + a + '"' : "Inline Fragment" : b.kind === graphql.Kind.OPERATION_DEFINITION ? c = (b.name ? '"' + b.name.value + '"' : "Unnamed") + " " + b.operation : b.kind === graphql.Kind.FRAGMENT_DEFINITION && (c = '"' + b.name.value + '" Fragment');
b.kind === kinds.Kind.INLINE_FRAGMENT ? c = a ? 'Inline Fragment on "' + a + '"' : "Inline Fragment" : b.kind === kinds.Kind.OPERATION_DEFINITION ? c = (b.name ? '"' + b.name.value + '"' : "Unnamed") + " " + b.operation : b.kind === kinds.Kind.FRAGMENT_DEFINITION && (c = '"' + b.name.value + '" Fragment');
c && currentDebugStack.push(c);

@@ -73,7 +73,7 @@ }, getDebugOutput = function() {

var isFragmentNode = function(a) {
return a.kind === graphql.Kind.FRAGMENT_DEFINITION;
return a.kind === kinds.Kind.FRAGMENT_DEFINITION;
};
function _ref(a) {
return a.kind === graphql.Kind.OPERATION_DEFINITION;
return a.kind === kinds.Kind.OPERATION_DEFINITION;
}

@@ -101,3 +101,3 @@

if (("include" === (a = getName(f)) || "skip" === a) && f.arguments && f.arguments[0] && "if" === getName(f.arguments[0])) {
return b = graphql.valueFromASTUntyped(f.arguments[0].value, b), "include" === a ? !!b : !b;
return b = valueFromASTUntyped.valueFromASTUntyped(f.arguments[0].value, b), "include" === a ? !!b : !b;
}

@@ -107,3 +107,3 @@ }

}, isFieldNullable = function(a, b, c) {
return !!(a = getField(a, b, c)) && graphql.isNullableType(a.type);
return !!(a = getField(a, b, c)) && definition.isNullableType(a.type);
}, isListNullable = function(a, b, c) {

@@ -113,4 +113,4 @@ if (!(a = getField(a, b, c))) {

}
a = graphql.isNonNullType(a.type) ? a.type.ofType : a.type;
return graphql.isListType(a) && graphql.isNullableType(a.ofType);
a = definition.isNonNullType(a.type) ? a.type.ofType : a.type;
return definition.isListType(a) && definition.isNullableType(a.ofType);
}, isFieldAvailableOnType = function(a, b, c) {

@@ -126,7 +126,7 @@ return !!getField(a, b, c);

var e = a.getType(b), d = a.getType(c);
if (e instanceof graphql.GraphQLObjectType) {
if (e instanceof definition.GraphQLObjectType) {
return e === d;
}
!function expectAbstractType(a, b) {
invariant(a instanceof graphql.GraphQLInterfaceType || a instanceof graphql.GraphQLUnionType, "production" !== process.env.NODE_ENV ? "Invalid Abstract type: The type `" + b + "` is not an Interface or Union type in the defined schema, but a fragment in the GraphQL document is using it as a type condition." : "", 5);
invariant(a instanceof definition.GraphQLInterfaceType || a instanceof definition.GraphQLUnionType, "production" !== process.env.NODE_ENV ? "Invalid Abstract type: The type `" + b + "` is not an Interface or Union type in the defined schema, but a fragment in the GraphQL document is using it as a type condition." : "", 5);
}(e, b);

@@ -142,3 +142,3 @@ expectObjectType(d, c);

function expectObjectType(a, b) {
invariant(a instanceof graphql.GraphQLObjectType, "production" !== process.env.NODE_ENV ? "Invalid Object type: The type `" + b + "` is not an object in the defined schema, but the GraphQL document is traversing it." : "", 3);
invariant(a instanceof definition.GraphQLObjectType, "production" !== process.env.NODE_ENV ? "Invalid Object type: The type `" + b + "` is not an object in the defined schema, but the GraphQL document is traversing it." : "", 3);
}

@@ -508,3 +508,3 @@

var d = b[c].fieldKey;
readLink(a, d) ? writeLink(a, d, void 0) : writeRecord(a, d, void 0);
void 0 !== readLink(a, d) ? writeLink(a, d, void 0) : writeRecord(a, d, void 0);
}

@@ -524,3 +524,3 @@ }, Store = function(a) {

if (a.schema) {
var f = this.schema = graphql.buildClientSchema(a.schema);
var f = this.schema = buildClientSchema.buildClientSchema(a.schema);
a = f.getQueryType();

@@ -527,0 +527,0 @@ var g = f.getMutationType();

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

"use strict";var e=require("./1cc90026.min.js"),t=require("graphql"),n=require("@urql/core"),r=require("wonka"),i=require("@urql/exchange-populate"),o=function(e){return e.name.value},a=function(e){return e.typeCondition.name.value},u=function(e){return e.alias?e.alias.value:o(e)},s=function(e){return e.selectionSet?e.selectionSet.selections:[]},c=function(e){return(e=e.typeCondition)?o(e):null},l=function(e){return e.kind===t.Kind.FIELD},f=function(e){return e.kind===t.Kind.INLINE_FRAGMENT},d=function(e,n){var r={},i=0;if(e.arguments&&e.arguments.length)for(var a=0,u=e.arguments.length;a<u;a++){var s=e.arguments[a],c=t.valueFromASTUntyped(s.value,n);null!=c&&(r[o(s)]=c,i++)}return 0<i?r:null},p=function(e,t){if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=o(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},y=function(e,n){var r={};if(!n)return r;if(e.variableDefinitions)for(var i=0,a=e.variableDefinitions.length;i<a;i++){var u=e.variableDefinitions[i],s=o(u.variable);r[s]=void 0===n[s]&&u.defaultValue?t.valueFromASTUntyped(u.defaultValue,n):n[s]}for(var c in n)c in r||(r[c]=n[c]);return r};function v(e,t,n){if(!e)throw(e=Error((t||"Minfied Error #"+n+"\n")+"\nhttps://bit.ly/38yWDau#"+n)).name="Graphcache Error",e}var m=function(e){return e.kind===t.Kind.FRAGMENT_DEFINITION};function h(e){return e.kind===t.Kind.OPERATION_DEFINITION}var g=function(e){return v(!!(e=e.definitions.find(h)),"",1),e};function k(e,t){return e[o(t)]=t,e}var x=function(e){return e.definitions.filter(m).reduce(k,{})},b=function(e,n){var r=e.directives;if(!r)return!0;for(var i=0,a=r.length;i<a;i++){var u=r[i];if(("include"===(e=o(u))||"skip"===e)&&u.arguments&&u.arguments[0]&&"if"===o(u.arguments[0]))return n=t.valueFromASTUntyped(u.arguments[0].value,n),"include"===e?!!n:!n}return!0},_=function(e,n,r){return!!(e=S(e,n,r))&&t.isNullableType(e.type)},O=function(e,n,r){return!!(e=S(e,n,r))&&(e=t.isNonNullType(e.type)?e.type.ofType:e.type,t.isListType(e)&&t.isNullableType(e.ofType))},q=function(e,n,r){return!(!r||!n)&&(r===n||(n=e.getType(n),r=e.getType(r),n instanceof t.GraphQLObjectType?n===r:(function(e,n){v(e instanceof t.GraphQLInterfaceType||e instanceof t.GraphQLUnionType,"",5)}(n),w(r),e.isPossibleType(n,r))))},S=function(e,t,n){return w(e=e.getType(t)),e.getFields()[n]};function w(e,n){v(e instanceof t.GraphQLObjectType,"",3)}var N=function(e,t){return t?e+"("+n.stringifyVariables(t)+")":e},E=function(e){var t=e.indexOf("(");return-1<t?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},K=function(e,t){return e+"."+t},T=function(e){return e.indexOf("\t")},F=function(){return Object.create(null)},A="undefined"!=typeof Promise?Promise.prototype.then.bind(Promise.resolve()):function(e){return setTimeout(e,0)},L=null,M=null,P=null,D=null,R=!1,I=function(){return{optimistic:F(),base:new Map}},Q=function(e,t,n){L=e,P=M,M=new Set,R=!1,t?n||1<e.optimisticOrder.length&&-1<e.optimisticOrder.indexOf(t)?(n||e.commutativeKeys.has(t)||(ue(e,t),e.commutativeKeys.add(t)),D=t,ae(e,t)):(D=null,se(e,t)):D=null},C=function(){var e=L,t=D;if(D=null,t&&-1<e.optimisticOrder.indexOf(t))for(t=e.optimisticOrder.length;0<=--t&&e.refLock[e.optimisticOrder[t]]&&e.commutativeKeys.has(e.optimisticOrder[t]);)fe(e.optimisticOrder[t]);e.defer||(e.defer=!0,A((function(){Q(e,null),Z(),pe(),C(),e.defer=!1}))),M=L=null},j=function(e,t,n){Q(e,t,n),C()},G=function(){return v(null!==M,"",2),M},V=function(){return P=M,M=new Set},U=function(){M=P,P=null},W=function(e,t,n,r){var i=(e=D?e.optimistic[D]:e.base).get(t);void 0===i&&e.set(t,i=F()),void 0!==r||D?i[n]=r:delete i[n]},J=function(e,t,n){for(var r,i=0,o=L.optimisticOrder.length;i<o;i++){var a=L.optimisticOrder[i],u=e.optimistic[a];if(u&&(!R||L.commutativeKeys.has(a))&&void 0!==(r=u.get(t))&&n in r)return r[n]}return void 0!==(r=e.base.get(t))?r[n]:void 0},B=function(e,t,n,r){var i=void 0!==t[n]?t[n]:0;t=t[n]=i+r|0,void 0!==e&&(0>=t?e.add(n):0>=i&&0<t&&e.delete(n))},z=function(e,t,n,r){if("string"==typeof n)B(e,t,n,r);else if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++){var a=n[i];a&&B(e,t,a,r)}},H=function(e,t,n){if(void 0!==n)for(var r in n)t.has(r)||(e.push(E(r)),t.add(r))},X=function(e,t,n,r){H(e,t,r.base.get(n));for(var i=0,o=L.optimisticOrder.length;i<o;i++){var a=r.optimistic[L.optimisticOrder[i]];void 0!==a&&H(e,t,a.get(n))}};function Y(e,t,n){if(0<(L.refCount[e]||0))n.delete(e);else{for(var r in L.refLock){if(0<((t=L.refLock[r])[e]||0))return;delete t[e]}if(delete L.refCount[e],n.delete(e),L.records.base.delete(e),r=L.links.base.get(e))for(var i in L.links.base.delete(e),r)z(n,L.refCount,r[i],-1)}}var Z=function(){L.gc.forEach(Y)},$=function(e,t){"__typename"!==t&&(e!==L.queryRootKey?M.add(e):void 0!==t&&M.add(K(e,t)))},ee=function(e,t){L.storage&&L.persist.add(function(e,t){return e+"\t"+t}(e,t))},te=function(e,t){return $(e,t),J(L.records,e,t)},ne=function(e,t){return $(e,t),J(L.links,e,t)},re=function(e,t,n){$(e,t),ee(e,t),W(L.records,e,t,n)},ie=function(e,t,n){var r=L;if(D)var i=r.refLock[D]||(r.refLock[D]=F()),o=r.links.optimistic[D];else{i=r.refCount,o=r.links.base;var a=r.gc}o=(o=o&&o.get(e))&&o[t],$(e,t),ee(e,t),W(r.links,e,t,n),z(a,i,o,-1),z(a,i,n,1)},oe=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.commutativeKeys.add(t)},ae=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.refLock[t]||(e.refLock[t]=F(),e.links.optimistic[t]=new Map,e.records.optimistic[t]=new Map)},ue=function(e,t){e.refLock[t]&&(delete e.refLock[t],delete e.records.optimistic[t],delete e.links.optimistic[t])},se=function(e,t){var n=e.optimisticOrder.indexOf(t);-1<n&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),ue(e,t)};function ce(e,t){for(var n in e)ie(t,n,e[n])}function le(e,t){for(var n in e)re(t,n,e[n])}var fe=function(e){V();var t=L.links.optimistic[e];t&&t.forEach(ce),(t=L.records.optimistic[e])&&t.forEach(le),U(),se(L,e)},de=function(e){var t=L.links,n=L.records,r=[],i=new Set;return $(e),X(r,i,e,t),X(r,i,e,n),r},pe=function(){if(L.storage){var e=F();R=!0,L.persist.forEach((function(t){var r=T(t);if(-1<r){var i,o=t.slice(0,r);r=t.slice(r+1),e[t]=void 0!==(i=ne(o,r))?":"+n.stringifyVariables(i):void 0!==(i=te(o,r))?n.stringifyVariables(i):void 0}})),R=!1,L.storage.write(e),L.persist.clear()}},ye=function(e,t,n,r,i,o){return{store:e,variables:t,fragments:n,parentTypeName:r,parentKey:i,parentFieldKey:"",fieldName:"",partial:!1,optimistic:!!o}},ve=function(e,t,n,r,i){e.parentTypeName=t,e.parentKey=n,e.parentFieldKey=r,e.fieldName=i},me=function(e,t,n,r){return!(!t||t!==c(e)&&s(e).some((function(e){return!!l(e)&&(e=N(o(e),d(e,r)),!function(e,t){return void 0!==te(e,t)||void 0!==ne(e,t)}(n,e))})))},he=function(e,t,n,r){this.typename=e,this.entityKey=t,this.context=r,this.indexStack=[0],this.selectionStack=[n]};he.prototype.next=function(){for(;0!==this.indexStack.length;){var e=this.indexStack[this.indexStack.length-1]++,t=this.selectionStack[this.selectionStack.length-1];if(e>=t.length)this.indexStack.pop(),this.selectionStack.pop();else if(b(e=t[e],this.context.variables))if(l(e)){if("__typename"!==o(e))return e}else void 0!==(e=f(e)?e:this.context.fragments[o(e)])&&(this.context.store.schema?q(this.context.store.schema,c(e),this.typename):me(e,this.typename,this.entityKey,this.context.variables))&&(this.indexStack.push(0),this.selectionStack.push(s(e)))}};var ge=function(e){return void 0===e?null:e},ke=function(e,t,n,r){return Q(e.data,r||null),e=xe(e,t,n),C(),e},xe=function(e,t,n){var r=g(t.query),i={data:n,dependencies:G()},o=e.rootFields[r.operation];return e=ye(e,y(r,t.variables),x(t.query),o,o),_e(e,o,s(r),n),i},be=function(e,t,n){Q(e.data,n,!0),n=g(t.query);var r={data:{},dependencies:G()},i=e.rootFields[n.operation];return v(i===e.rootFields.mutation,"",10),e=ye(e,y(n,t.variables),x(t.query),i,i,!0),_e(e,i,s(n),r.data),C(),r},_e=function(e,t,n,r){var i=t===e.store.rootFields.query,a=!i&&!!e.store.rootNames[t],c=a||i?t:r.__typename;if(c){a||i||!t||re(t,"__typename",c),n=new he(c,t||c,n,e);for(var l;l=n.next();){i=o(l);var f=d(l,e.variables),p=N(i,f),y=u(l),v=r[y];if(e.optimistic&&a){if(!(v=e.store.optimisticMutations[i]))continue;ve(e,c,c,p,i),v=r[y]=ge(v(f||{},e.store,e))}l.selectionSet?t&&!a?(y=K(t,p),l=Oe(e,s(l),ge(v),y),ie(t||c,p,l)):Oe(e,s(l),ge(v)):t&&!a&&re(t||c,p,v),a&&(ve(e,c,c,K(c,p),i),p=e.store.updates[c][i])&&(r[i]=v,p(r,f||{},e.store,e))}}},Oe=function(e,t,n,r){if(Array.isArray(n)){for(var i=Array(n.length),o=0,a=n.length;o<a;o++){var u=n[o],s=r?K(r,""+o):void 0;u=Oe(e,t,u,s),i[o]=u}return i}return null===n?null:(i=e.store.keyOfEntity(n),o=n.__typename,!r||void 0!==e.store.keys[n.__typename]||null!==i||"string"!=typeof o||o.endsWith("Connection")||o.endsWith("Edge"),_e(e,r=i||r,t,n),r||null)},qe=function(e,t,n){t=t?[{fieldKey:N(t,n)}]:de(e),n=0;for(var r=t.length;n<r;n++){var i=t[n].fieldKey;ne(e,i)?ie(e,i,void 0):re(e,i,void 0)}},Se=function(e){var n;this.keyOfField=N,e||(e={}),this.resolvers=e.resolvers||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.updates={Mutation:e.updates&&e.updates.Mutation||{},Subscription:e.updates&&e.updates.Subscription||{}};var r="Query",i="Mutation",o="Subscription";if(e.schema){var a=this.schema=t.buildClientSchema(e.schema);e=a.getQueryType();var u=a.getMutationType();a=a.getSubscriptionType(),e&&(r=e.name),u&&(i=u.name),a&&(o=a.name)}this.rootFields={query:r,mutation:i,subscription:o},this.rootNames=((n={})[r]="query",n[i]="mutation",n[o]="subscription",n),this.data=function(e){return{defer:!1,gc:new Set,persist:new Set,queryRootKey:e,refCount:F(),refLock:F(),links:I(),records:I(),commutativeKeys:new Set,optimisticOrder:[],storage:null}}(r)};Se.prototype.keyOfEntity=function(e){var t,n=e.__typename,r=e.id,i=e._id;return n?void 0!==this.rootNames[n]?n:(this.keys[n]?t=this.keys[n](e):null!=r?t=""+r:null!=i&&(t=""+i),t?n+":"+t:null):null},Se.prototype.resolveFieldByKey=function(e,t){if(null===(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e))return null;var n=te(e,t);return void 0!==n?n:(t=ne(e,t))?t:null},Se.prototype.resolve=function(e,t,n){return this.resolveFieldByKey(e,N(t,n))},Se.prototype.invalidateQuery=function(e,t){!function(e,t){var n=V();Ne(e,t),U(),n.forEach((function(t){t.startsWith(e.data.queryRootKey+".")?(t=t.slice((e.data.queryRootKey+".").length),ie(e.data.queryRootKey,t),re(e.data.queryRootKey,t)):qe(t)})),Z()}(this,n.createRequest(e,t))},Se.prototype.invalidate=function(e,t,n){v(e="string"==typeof e?e:this.keyOfEntity(e),"",19),qe(e,t,n)},Se.prototype.inspectFields=function(e){return null!==(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e)?de(e):[]},Se.prototype.updateQuery=function(e,t){e=n.createRequest(e.query,e.variables),null!==(t=t(this.readQuery(e)))&&xe(this,e,t)},Se.prototype.readQuery=function(e){return Ne(this,n.createRequest(e.query,e.variables)).data},Se.prototype.readFragment=function(e,t,n){return Te(this,e,t,n)},Se.prototype.writeFragment=function(t,n,r){!function(t,n,r,i){n=x(n);var o=Object.keys(n);if(void 0!==(o=n[o[0]])){var u=a(o);r=e._extends({},{__typename:u},r);var c=t.keyOfEntity(r);c&&(t=ye(t,i||{},n,u,c),_e(t,c,s(o),r))}}(this,t,n,r)};var we=function(e,t,n){return Q(e.data,null),e=Ne(e,t,n),C(),e},Ne=function(e,t,n){var r=g(t.query),i=e.rootFields[r.operation],o=s(r);return n=n||{},n=i!==(e=ye(e,y(r,t.variables),x(t.query),i,i)).store.rootFields.query?Ee(e,i,o,n):Fe(e,i,o,n),{dependencies:G(),partial:void 0!==n&&e.partial,data:void 0===n?null:n}},Ee=function(e,t,n,r){if("string"!=typeof r.__typename)return r;t=new he(t,t,n,e),(n={}).__typename=r.__typename;for(var i;void 0!==(i=t.next());){var o=u(i),a=r[o];void 0!==i.selectionSet&&null!==a?(a=ge(a),n[o]=Ke(e,s(i),a)):n[o]=a}return n},Ke=function(e,t,n){if(Array.isArray(n)){for(var r=Array(n.length),i=0,o=n.length;i<o;i++)r[i]=Ke(e,t,n[i]);return r}return null===n?null:null!==(r=e.store.keyOfEntity(n))?void 0===(e=Fe(e,r,t,{}))?null:e:Ee(e,n.__typename,t,n)},Te=function(t,n,r,i){n=x(n);var o=Object.keys(n);if(void 0===(o=n[o[0]]))return null;var u=a(o);return"string"==typeof r||r.__typename||(r.__typename=u),(r="string"!=typeof r?t.keyOfEntity(e._extends({},{__typename:u},r)):r)?(t=ye(t,i||{},n,u,r),Fe(t,r,s(o),{})||null):null},Fe=function(e,t,n,r,i){var a=e.store,c=t===a.rootFields.query,l=i&&a.keyOfEntity(i)||t;if(!("string"!=typeof(t=c?t:te(l,"__typename")||i&&i.__typename)||i&&t!==i.__typename)){r.__typename=t,n=new he(t,l,n,e);for(var f,p=!1,y=!1;void 0!==(f=n.next());){var v=o(f),m=d(f,e.variables),h=u(f),g=N(v,m),k=K(l,g),x=te(l,g),b=i?i[v]:void 0,O=a.resolvers[t],q=void 0;if(void 0!==b&&void 0===f.selectionSet)q=b;else if(O&&"function"==typeof O[v]){if(ve(e,t,l,k,v),void 0!==x&&(r[h]=x),q=O[v](r,m||{},a,e),void 0!==f.selectionSet&&(q=Ae(e,t,v,k,s(f),r[h]||{},q)),a.schema&&null===q&&!_(a.schema,t,v))return}else void 0===f.selectionSet?q=x:void 0!==b?q=Ae(e,t,v,k,s(f),r[h],b):void 0!==(m=ne(l,g))?q=Le(e,m,t,v,s(f),r[h]):"object"==typeof x&&null!==x&&(q=x);if(void 0===q&&a.schema&&_(a.schema,t,v))y=!0,r[h]=null;else{if(void 0===q)return;p=!0,r[h]=q}}return y&&(e.partial=!0),c&&y&&!p?void 0:r}},Ae=function(e,t,n,r,i,o,a){if(Array.isArray(a)){var u=e.store;u=!u.schema||O(u.schema,t,n);for(var s=Array(a.length),c=0,l=a.length;c<l;c++){var f=Ae(e,t,n,K(r,""+c),i,void 0!==o?o[c]:void 0,a[c]);if(void 0===f&&!u)return;s[c]=void 0!==f?f:null}return s}return null==a?a:Me(a)?(t=void 0===o?{}:o,"string"==typeof a?Fe(e,a,i,t):Fe(e,r,i,t,a)):void 0},Le=function(e,t,n,r,i,o){if(Array.isArray(t)){var a=e.store;a=a.schema&&O(a.schema,n,r);for(var u=Array(t.length),s=0,c=t.length;s<c;s++){var l=Le(e,t[s],n,r,i,void 0!==o?o[s]:void 0);if(void 0===l&&!a)return;u[s]=void 0!==l?l:null}return u}return null===t?null:Fe(e,t,i,void 0===o?{}:o)},Me=function(e){return"string"==typeof e||"object"==typeof e&&"string"==typeof e.__typename},Pe=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{meta:e._extends({},t.context.meta,{cacheOutcome:n})})})},De=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{requestPolicy:n})})};function Re(e){return"query"===e.operationName&&"network-only"!==e.context.requestPolicy}function Ie(e){return"query"!==e.operationName||"network-only"===e.context.requestPolicy}function Qe(e){return Pe(e.operation,"miss")}function Ce(e){return"miss"===e.outcome&&"cache-only"!==e.operation.context.requestPolicy}function je(e){return"miss"!==e.outcome||"cache-only"===e.operation.context.requestPolicy}exports.populateExchange=i.populateExchange,exports.Store=Se,exports.cacheExchange=function(t){return function(i){function o(e){var t=e.operation,n=e.outcome;return e={operation:Pe(t,n),data:e.data,error:e.error,extensions:e.extensions},("cache-and-network"===t.context.requestPolicy||"cache-first"===t.context.requestPolicy&&"partial"===n)&&(e.stale=!0,s.reexecuteOperation(De(t,"network-only"))),e}var a,u=i.forward,s=i.client,c=new Se(t);t&&t.storage&&(a=t.storage.read().then((function(e){!function(e,t,n){for(var r in Q(e,null),n){var i=n[r],o=T(r);if(i&&-1<o){var a=r.slice(0,o);o=r.slice(o+1),":"===i[0]?ie(a,o,JSON.parse(i.slice(1))):re(a,o,JSON.parse(i))}}C(),e.storage=t}(c.data,t.storage,e)})));var l=new Map,f=new Map,d=F(),y=function(e,t){t&&t.forEach((function(t){var n=d[t];if(n){d[t]=[],t=0;for(var r=n.length;t<r;t++)e.add(n[t])}}))},v=function(e,t){t.forEach((function(t){if(t!==e.key){var n=f.get(t);n&&(f.delete(t),s.reexecuteOperation(De(n,"cache-first")))}}))},m=function(t){if("query"===t.operationName)oe(c.data,t.key);else if("teardown"===t.operationName)j(c.data,t.key);else if("mutation"===t.operationName)if("network-only"!==t.context.requestPolicy){var r=be(c,t,t.key).dependencies;if(0!==r.size){l.set(t.key,r);var i=new Set;y(i,r),v(t,i)}}else oe(c.data,t.key);return e._extends({},t,{variables:t.variables?p(g(t.query),t.variables):t.variables,query:n.formatDocument(t.query)})},h=function(e,t){t.forEach((function(t){(d[t]||(d[t]=[])).push(e.key),f.has(e.key)||f.set(e.key,"network-only"===e.context.requestPolicy?De(e,"cache-and-network"):e)}))},k=function(e){var t=we(c,e),n=t.data?t.partial?"partial":"hit":"miss";return t.data&&h(e,t.dependencies),{outcome:n,operation:e,data:t.data}},x=function(e){var t=e.operation,n=e.error,r=e.extensions,i=t.key,o=new Set;if("mutation"===t.operationName?(y(o,l.get(i)),l.delete(i)):oe(c.data,t.key),e.data){if(i=ke(c,t,e.data,i).dependencies,y(o,i),i=we(c,t,e.data),e.data=i.data,"query"===t.operationName){var a=i.dependencies;y(o,a)}}else j(c.data,t.key);return v(e.operation,o),a&&h(e.operation,a),{data:e.data,error:n,extensions:r,operation:t}};return function(e){e=r.share(e);var t=a?r.mergeMap(r.fromArray)(r.take(1)(r.buffer(r.fromPromise(a))(e))):r.empty;t=r.share(r.concat([t,e])),e=r.share(r.map(k)(r.filter(Re)(t))),t=r.filter(Ie)(t);var n=r.map(Qe)(r.filter(Ce)(e));return e=r.map(o)(r.filter(je)(e)),t=r.map(x)(u(r.map(m)(r.merge([t,n])))),r.merge([t,e])}}},exports.noopDataState=j,exports.query=we,exports.reserveLayer=oe,exports.write=ke,exports.writeOptimistic=be;
"use strict";var e=require("./1cc90026.min.js"),t=require("graphql/utilities/valueFromASTUntyped"),n=require("graphql/language/kinds"),r=require("graphql/type/definition"),i=require("@urql/core"),o=require("graphql/utilities/buildClientSchema"),a=require("wonka"),u=require("@urql/exchange-populate"),s=function(e){return e.name.value},c=function(e){return e.typeCondition.name.value},l=function(e){return e.alias?e.alias.value:s(e)},f=function(e){return e.selectionSet?e.selectionSet.selections:[]},d=function(e){return(e=e.typeCondition)?s(e):null},p=function(e){return e.kind===n.Kind.FIELD},y=function(e){return e.kind===n.Kind.INLINE_FRAGMENT},v=function(e,n){var r={},i=0;if(e.arguments&&e.arguments.length)for(var o=0,a=e.arguments.length;o<a;o++){var u=e.arguments[o],c=t.valueFromASTUntyped(u.value,n);null!=c&&(r[s(u)]=c,i++)}return 0<i?r:null},m=function(e,t){if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var o=s(e.variableDefinitions[r].variable);n[o]=t[o]}return n}},h=function(e,n){var r={};if(!n)return r;if(e.variableDefinitions)for(var i=0,o=e.variableDefinitions.length;i<o;i++){var a=e.variableDefinitions[i],u=s(a.variable);r[u]=void 0===n[u]&&a.defaultValue?t.valueFromASTUntyped(a.defaultValue,n):n[u]}for(var c in n)c in r||(r[c]=n[c]);return r};function g(e,t,n){if(!e)throw(e=Error((t||"Minfied Error #"+n+"\n")+"\nhttps://bit.ly/38yWDau#"+n)).name="Graphcache Error",e}var k=function(e){return e.kind===n.Kind.FRAGMENT_DEFINITION};function x(e){return e.kind===n.Kind.OPERATION_DEFINITION}var b=function(e){return g(!!(e=e.definitions.find(x)),"",1),e};function q(e,t){return e[s(t)]=t,e}var _=function(e){return e.definitions.filter(k).reduce(q,{})},O=function(e,n){var r=e.directives;if(!r)return!0;for(var i=0,o=r.length;i<o;i++){var a=r[i];if(("include"===(e=s(a))||"skip"===e)&&a.arguments&&a.arguments[0]&&"if"===s(a.arguments[0]))return n=t.valueFromASTUntyped(a.arguments[0].value,n),"include"===e?!!n:!n}return!0},S=function(e,t,n){return!!(e=E(e,t,n))&&r.isNullableType(e.type)},w=function(e,t,n){return!!(e=E(e,t,n))&&(e=r.isNonNullType(e.type)?e.type.ofType:e.type,r.isListType(e)&&r.isNullableType(e.ofType))},N=function(e,t,n){return!(!n||!t)&&(n===t||(t=e.getType(t),n=e.getType(n),t instanceof r.GraphQLObjectType?t===n:(function(e,t){g(e instanceof r.GraphQLInterfaceType||e instanceof r.GraphQLUnionType,"",5)}(t),K(n),e.isPossibleType(t,n))))},E=function(e,t,n){return K(e=e.getType(t)),e.getFields()[n]};function K(e,t){g(e instanceof r.GraphQLObjectType,"",3)}var T=function(e,t){return t?e+"("+i.stringifyVariables(t)+")":e},F=function(e){var t=e.indexOf("(");return-1<t?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},A=function(e,t){return e+"."+t},L=function(e){return e.indexOf("\t")},M=function(){return Object.create(null)},P="undefined"!=typeof Promise?Promise.prototype.then.bind(Promise.resolve()):function(e){return setTimeout(e,0)},D=null,R=null,I=null,C=null,Q=!1,j=function(){return{optimistic:M(),base:new Map}},G=function(e,t,n){D=e,I=R,R=new Set,Q=!1,t?n||1<e.optimisticOrder.length&&-1<e.optimisticOrder.indexOf(t)?(n||e.commutativeKeys.has(t)||(le(e,t),e.commutativeKeys.add(t)),C=t,ce(e,t)):(C=null,fe(e,t)):C=null},U=function(){var e=D,t=C;if(C=null,t&&-1<e.optimisticOrder.indexOf(t))for(t=e.optimisticOrder.length;0<=--t&&e.refLock[e.optimisticOrder[t]]&&e.commutativeKeys.has(e.optimisticOrder[t]);)ye(e.optimisticOrder[t]);e.defer||(e.defer=!0,P((function(){G(e,null),te(),me(),U(),e.defer=!1}))),R=D=null},V=function(e,t,n){G(e,t,n),U()},W=function(){return g(null!==R,"",2),R},J=function(){return I=R,R=new Set},B=function(){R=I,I=null},z=function(e,t,n,r){var i=(e=C?e.optimistic[C]:e.base).get(t);void 0===i&&e.set(t,i=M()),void 0!==r||C?i[n]=r:delete i[n]},H=function(e,t,n){for(var r,i=0,o=D.optimisticOrder.length;i<o;i++){var a=D.optimisticOrder[i],u=e.optimistic[a];if(u&&(!Q||D.commutativeKeys.has(a))&&void 0!==(r=u.get(t))&&n in r)return r[n]}return void 0!==(r=e.base.get(t))?r[n]:void 0},X=function(e,t,n,r){var i=void 0!==t[n]?t[n]:0;t=t[n]=i+r|0,void 0!==e&&(0>=t?e.add(n):0>=i&&0<t&&e.delete(n))},Y=function(e,t,n,r){if("string"==typeof n)X(e,t,n,r);else if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++){var a=n[i];a&&X(e,t,a,r)}},Z=function(e,t,n){if(void 0!==n)for(var r in n)t.has(r)||(e.push(F(r)),t.add(r))},$=function(e,t,n,r){Z(e,t,r.base.get(n));for(var i=0,o=D.optimisticOrder.length;i<o;i++){var a=r.optimistic[D.optimisticOrder[i]];void 0!==a&&Z(e,t,a.get(n))}};function ee(e,t,n){if(0<(D.refCount[e]||0))n.delete(e);else{for(var r in D.refLock){if(0<((t=D.refLock[r])[e]||0))return;delete t[e]}if(delete D.refCount[e],n.delete(e),D.records.base.delete(e),r=D.links.base.get(e))for(var i in D.links.base.delete(e),r)Y(n,D.refCount,r[i],-1)}}var te=function(){D.gc.forEach(ee)},ne=function(e,t){"__typename"!==t&&(e!==D.queryRootKey?R.add(e):void 0!==t&&R.add(A(e,t)))},re=function(e,t){D.storage&&D.persist.add(function(e,t){return e+"\t"+t}(e,t))},ie=function(e,t){return ne(e,t),H(D.records,e,t)},oe=function(e,t){return ne(e,t),H(D.links,e,t)},ae=function(e,t,n){ne(e,t),re(e,t),z(D.records,e,t,n)},ue=function(e,t,n){var r=D;if(C)var i=r.refLock[C]||(r.refLock[C]=M()),o=r.links.optimistic[C];else{i=r.refCount,o=r.links.base;var a=r.gc}o=(o=o&&o.get(e))&&o[t],ne(e,t),re(e,t),z(r.links,e,t,n),Y(a,i,o,-1),Y(a,i,n,1)},se=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.commutativeKeys.add(t)},ce=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.refLock[t]||(e.refLock[t]=M(),e.links.optimistic[t]=new Map,e.records.optimistic[t]=new Map)},le=function(e,t){e.refLock[t]&&(delete e.refLock[t],delete e.records.optimistic[t],delete e.links.optimistic[t])},fe=function(e,t){var n=e.optimisticOrder.indexOf(t);-1<n&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),le(e,t)};function de(e,t){for(var n in e)ue(t,n,e[n])}function pe(e,t){for(var n in e)ae(t,n,e[n])}var ye=function(e){J();var t=D.links.optimistic[e];t&&t.forEach(de),(t=D.records.optimistic[e])&&t.forEach(pe),B(),fe(D,e)},ve=function(e){var t=D.links,n=D.records,r=[],i=new Set;return ne(e),$(r,i,e,t),$(r,i,e,n),r},me=function(){if(D.storage){var e=M();Q=!0,D.persist.forEach((function(t){var n=L(t);if(-1<n){var r,o=t.slice(0,n);n=t.slice(n+1),e[t]=void 0!==(r=oe(o,n))?":"+i.stringifyVariables(r):void 0!==(r=ie(o,n))?i.stringifyVariables(r):void 0}})),Q=!1,D.storage.write(e),D.persist.clear()}},he=function(e,t,n,r,i,o){return{store:e,variables:t,fragments:n,parentTypeName:r,parentKey:i,parentFieldKey:"",fieldName:"",partial:!1,optimistic:!!o}},ge=function(e,t,n,r,i){e.parentTypeName=t,e.parentKey=n,e.parentFieldKey=r,e.fieldName=i},ke=function(e,t,n,r){return!(!t||t!==d(e)&&f(e).some((function(e){return!!p(e)&&(e=T(s(e),v(e,r)),!function(e,t){return void 0!==ie(e,t)||void 0!==oe(e,t)}(n,e))})))},xe=function(e,t,n,r){this.typename=e,this.entityKey=t,this.context=r,this.indexStack=[0],this.selectionStack=[n]};xe.prototype.next=function(){for(;0!==this.indexStack.length;){var e=this.indexStack[this.indexStack.length-1]++,t=this.selectionStack[this.selectionStack.length-1];if(e>=t.length)this.indexStack.pop(),this.selectionStack.pop();else if(O(e=t[e],this.context.variables))if(p(e)){if("__typename"!==s(e))return e}else void 0!==(e=y(e)?e:this.context.fragments[s(e)])&&(this.context.store.schema?N(this.context.store.schema,d(e),this.typename):ke(e,this.typename,this.entityKey,this.context.variables))&&(this.indexStack.push(0),this.selectionStack.push(f(e)))}};var be=function(e){return void 0===e?null:e},qe=function(e,t,n,r){return G(e.data,r||null),e=_e(e,t,n),U(),e},_e=function(e,t,n){var r=b(t.query),i={data:n,dependencies:W()},o=e.rootFields[r.operation];return e=he(e,h(r,t.variables),_(t.query),o,o),Se(e,o,f(r),n),i},Oe=function(e,t,n){G(e.data,n,!0),n=b(t.query);var r={data:{},dependencies:W()},i=e.rootFields[n.operation];return g(i===e.rootFields.mutation,"",10),e=he(e,h(n,t.variables),_(t.query),i,i,!0),Se(e,i,f(n),r.data),U(),r},Se=function(e,t,n,r){var i=t===e.store.rootFields.query,o=!i&&!!e.store.rootNames[t],a=o||i?t:r.__typename;if(a){o||i||!t||ae(t,"__typename",a),n=new xe(a,t||a,n,e);for(var u;u=n.next();){i=s(u);var c=v(u,e.variables),d=T(i,c),p=l(u),y=r[p];if(e.optimistic&&o){if(!(y=e.store.optimisticMutations[i]))continue;ge(e,a,a,d,i),y=r[p]=be(y(c||{},e.store,e))}u.selectionSet?t&&!o?(p=A(t,d),u=we(e,f(u),be(y),p),ue(t||a,d,u)):we(e,f(u),be(y)):t&&!o&&ae(t||a,d,y),o&&(ge(e,a,a,A(a,d),i),d=e.store.updates[a][i])&&(r[i]=y,d(r,c||{},e.store,e))}}},we=function(e,t,n,r){if(Array.isArray(n)){for(var i=Array(n.length),o=0,a=n.length;o<a;o++){var u=n[o],s=r?A(r,""+o):void 0;u=we(e,t,u,s),i[o]=u}return i}return null===n?null:(i=e.store.keyOfEntity(n),o=n.__typename,!r||void 0!==e.store.keys[n.__typename]||null!==i||"string"!=typeof o||o.endsWith("Connection")||o.endsWith("Edge"),Se(e,r=i||r,t,n),r||null)},Ne=function(e,t,n){t=t?[{fieldKey:T(t,n)}]:ve(e),n=0;for(var r=t.length;n<r;n++){var i=t[n].fieldKey;void 0!==oe(e,i)?ue(e,i,void 0):ae(e,i,void 0)}},Ee=function(e){var t;this.keyOfField=T,e||(e={}),this.resolvers=e.resolvers||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.updates={Mutation:e.updates&&e.updates.Mutation||{},Subscription:e.updates&&e.updates.Subscription||{}};var n="Query",r="Mutation",i="Subscription";if(e.schema){var a=this.schema=o.buildClientSchema(e.schema);e=a.getQueryType();var u=a.getMutationType();a=a.getSubscriptionType(),e&&(n=e.name),u&&(r=u.name),a&&(i=a.name)}this.rootFields={query:n,mutation:r,subscription:i},this.rootNames=((t={})[n]="query",t[r]="mutation",t[i]="subscription",t),this.data=function(e){return{defer:!1,gc:new Set,persist:new Set,queryRootKey:e,refCount:M(),refLock:M(),links:j(),records:j(),commutativeKeys:new Set,optimisticOrder:[],storage:null}}(n)};Ee.prototype.keyOfEntity=function(e){var t,n=e.__typename,r=e.id,i=e._id;return n?void 0!==this.rootNames[n]?n:(this.keys[n]?t=this.keys[n](e):null!=r?t=""+r:null!=i&&(t=""+i),t?n+":"+t:null):null},Ee.prototype.resolveFieldByKey=function(e,t){if(null===(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e))return null;var n=ie(e,t);return void 0!==n?n:(t=oe(e,t))?t:null},Ee.prototype.resolve=function(e,t,n){return this.resolveFieldByKey(e,T(t,n))},Ee.prototype.invalidateQuery=function(e,t){!function(e,t){var n=J();Te(e,t),B(),n.forEach((function(t){t.startsWith(e.data.queryRootKey+".")?(t=t.slice((e.data.queryRootKey+".").length),ue(e.data.queryRootKey,t),ae(e.data.queryRootKey,t)):Ne(t)})),te()}(this,i.createRequest(e,t))},Ee.prototype.invalidate=function(e,t,n){g(e="string"==typeof e?e:this.keyOfEntity(e),"",19),Ne(e,t,n)},Ee.prototype.inspectFields=function(e){return null!==(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e)?ve(e):[]},Ee.prototype.updateQuery=function(e,t){e=i.createRequest(e.query,e.variables),null!==(t=t(this.readQuery(e)))&&_e(this,e,t)},Ee.prototype.readQuery=function(e){return Te(this,i.createRequest(e.query,e.variables)).data},Ee.prototype.readFragment=function(e,t,n){return Le(this,e,t,n)},Ee.prototype.writeFragment=function(t,n,r){!function(t,n,r,i){n=_(n);var o=Object.keys(n);if(void 0!==(o=n[o[0]])){var a=c(o);r=e._extends({},{__typename:a},r);var u=t.keyOfEntity(r);u&&(t=he(t,i||{},n,a,u),Se(t,u,f(o),r))}}(this,t,n,r)};var Ke=function(e,t,n){return G(e.data,null),e=Te(e,t,n),U(),e},Te=function(e,t,n){var r=b(t.query),i=e.rootFields[r.operation],o=f(r);return n=n||{},n=i!==(e=he(e,h(r,t.variables),_(t.query),i,i)).store.rootFields.query?Fe(e,i,o,n):Me(e,i,o,n),{dependencies:W(),partial:void 0!==n&&e.partial,data:void 0===n?null:n}},Fe=function(e,t,n,r){if("string"!=typeof r.__typename)return r;t=new xe(t,t,n,e),(n={}).__typename=r.__typename;for(var i;void 0!==(i=t.next());){var o=l(i),a=r[o];void 0!==i.selectionSet&&null!==a?(a=be(a),n[o]=Ae(e,f(i),a)):n[o]=a}return n},Ae=function(e,t,n){if(Array.isArray(n)){for(var r=Array(n.length),i=0,o=n.length;i<o;i++)r[i]=Ae(e,t,n[i]);return r}return null===n?null:null!==(r=e.store.keyOfEntity(n))?void 0===(e=Me(e,r,t,{}))?null:e:Fe(e,n.__typename,t,n)},Le=function(t,n,r,i){n=_(n);var o=Object.keys(n);if(void 0===(o=n[o[0]]))return null;var a=c(o);return"string"==typeof r||r.__typename||(r.__typename=a),(r="string"!=typeof r?t.keyOfEntity(e._extends({},{__typename:a},r)):r)?(t=he(t,i||{},n,a,r),Me(t,r,f(o),{})||null):null},Me=function(e,t,n,r,i){var o=e.store,a=t===o.rootFields.query,u=i&&o.keyOfEntity(i)||t;if(!("string"!=typeof(t=a?t:ie(u,"__typename")||i&&i.__typename)||i&&t!==i.__typename)){r.__typename=t,n=new xe(t,u,n,e);for(var c,d=!1,p=!1;void 0!==(c=n.next());){var y=s(c),m=v(c,e.variables),h=l(c),g=T(y,m),k=A(u,g),x=ie(u,g),b=i?i[y]:void 0,q=o.resolvers[t],_=void 0;if(void 0!==b&&void 0===c.selectionSet)_=b;else if(q&&"function"==typeof q[y]){if(ge(e,t,u,k,y),void 0!==x&&(r[h]=x),_=q[y](r,m||{},o,e),void 0!==c.selectionSet&&(_=Pe(e,t,y,k,f(c),r[h]||{},_)),o.schema&&null===_&&!S(o.schema,t,y))return}else void 0===c.selectionSet?_=x:void 0!==b?_=Pe(e,t,y,k,f(c),r[h],b):void 0!==(m=oe(u,g))?_=De(e,m,t,y,f(c),r[h]):"object"==typeof x&&null!==x&&(_=x);if(void 0===_&&o.schema&&S(o.schema,t,y))p=!0,r[h]=null;else{if(void 0===_)return;d=!0,r[h]=_}}return p&&(e.partial=!0),a&&p&&!d?void 0:r}},Pe=function(e,t,n,r,i,o,a){if(Array.isArray(a)){var u=e.store;u=!u.schema||w(u.schema,t,n);for(var s=Array(a.length),c=0,l=a.length;c<l;c++){var f=Pe(e,t,n,A(r,""+c),i,void 0!==o?o[c]:void 0,a[c]);if(void 0===f&&!u)return;s[c]=void 0!==f?f:null}return s}return null==a?a:Re(a)?(t=void 0===o?{}:o,"string"==typeof a?Me(e,a,i,t):Me(e,r,i,t,a)):void 0},De=function(e,t,n,r,i,o){if(Array.isArray(t)){var a=e.store;a=a.schema&&w(a.schema,n,r);for(var u=Array(t.length),s=0,c=t.length;s<c;s++){var l=De(e,t[s],n,r,i,void 0!==o?o[s]:void 0);if(void 0===l&&!a)return;u[s]=void 0!==l?l:null}return u}return null===t?null:Me(e,t,i,void 0===o?{}:o)},Re=function(e){return"string"==typeof e||"object"==typeof e&&"string"==typeof e.__typename},Ie=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{meta:e._extends({},t.context.meta,{cacheOutcome:n})})})},Ce=function(t,n){return e._extends({},t,{context:e._extends({},t.context,{requestPolicy:n})})};function Qe(e){return"query"===e.operationName&&"network-only"!==e.context.requestPolicy}function je(e){return"query"!==e.operationName||"network-only"===e.context.requestPolicy}function Ge(e){return Ie(e.operation,"miss")}function Ue(e){return"miss"===e.outcome&&"cache-only"!==e.operation.context.requestPolicy}function Ve(e){return"miss"!==e.outcome||"cache-only"===e.operation.context.requestPolicy}exports.populateExchange=u.populateExchange,exports.Store=Ee,exports.cacheExchange=function(t){return function(n){function r(e){var t=e.operation,n=e.outcome;return e={operation:Ie(t,n),data:e.data,error:e.error,extensions:e.extensions},("cache-and-network"===t.context.requestPolicy||"cache-first"===t.context.requestPolicy&&"partial"===n)&&(e.stale=!0,s.reexecuteOperation(Ce(t,"network-only"))),e}var o,u=n.forward,s=n.client,c=new Ee(t);t&&t.storage&&(o=t.storage.read().then((function(e){!function(e,t,n){for(var r in G(e,null),n){var i=n[r],o=L(r);if(i&&-1<o){var a=r.slice(0,o);o=r.slice(o+1),":"===i[0]?ue(a,o,JSON.parse(i.slice(1))):ae(a,o,JSON.parse(i))}}U(),e.storage=t}(c.data,t.storage,e)})));var l=new Map,f=new Map,d=M(),p=function(e,t){t&&t.forEach((function(t){var n=d[t];if(n){d[t]=[],t=0;for(var r=n.length;t<r;t++)e.add(n[t])}}))},y=function(e,t){t.forEach((function(t){if(t!==e.key){var n=f.get(t);n&&(f.delete(t),s.reexecuteOperation(Ce(n,"cache-first")))}}))},v=function(t){if("query"===t.operationName)se(c.data,t.key);else if("teardown"===t.operationName)V(c.data,t.key);else if("mutation"===t.operationName)if("network-only"!==t.context.requestPolicy){var n=Oe(c,t,t.key).dependencies;if(0!==n.size){l.set(t.key,n);var r=new Set;p(r,n),y(t,r)}}else se(c.data,t.key);return e._extends({},t,{variables:t.variables?m(b(t.query),t.variables):t.variables,query:i.formatDocument(t.query)})},h=function(e,t){t.forEach((function(t){(d[t]||(d[t]=[])).push(e.key),f.has(e.key)||f.set(e.key,"network-only"===e.context.requestPolicy?Ce(e,"cache-and-network"):e)}))},g=function(e){var t=Ke(c,e),n=t.data?t.partial?"partial":"hit":"miss";return t.data&&h(e,t.dependencies),{outcome:n,operation:e,data:t.data}},k=function(e){var t=e.operation,n=e.error,r=e.extensions,i=t.key,o=new Set;if("mutation"===t.operationName?(p(o,l.get(i)),l.delete(i)):se(c.data,t.key),e.data){if(i=qe(c,t,e.data,i).dependencies,p(o,i),i=Ke(c,t,e.data),e.data=i.data,"query"===t.operationName){var a=i.dependencies;p(o,a)}}else V(c.data,t.key);return y(e.operation,o),a&&h(e.operation,a),{data:e.data,error:n,extensions:r,operation:t}};return function(e){e=a.share(e);var t=o?a.mergeMap(a.fromArray)(a.take(1)(a.buffer(a.fromPromise(o))(e))):a.empty;t=a.share(a.concat([t,e])),e=a.share(a.map(g)(a.filter(Qe)(t))),t=a.filter(je)(t);var n=a.map(Ge)(a.filter(Ue)(e));return e=a.map(r)(a.filter(Ve)(e)),t=a.map(k)(u(a.map(v)(a.merge([t,n])))),a.merge([t,e])}}},exports.noopDataState=V,exports.query=Ke,exports.reserveLayer=se,exports.write=qe,exports.writeOptimistic=Oe;
//# sourceMappingURL=urql-exchange-graphcache.min.js.map

@@ -9,6 +9,6 @@ {

"dependencies": {
"@urql/core": ">=1.10.8",
"@urql/exchange-populate": ">=0.1.4",
"@urql/core": ">=1.10.9",
"@urql/exchange-populate": ">=0.1.5",
"wonka": "^4.0.9"
}
}
{
"name": "@urql/exchange-graphcache",
"version": "2.3.1",
"version": "2.3.2",
"description": "A normalized and configurable cache exchange for urql",

@@ -60,4 +60,4 @@ "sideEffects": false,

"dependencies": {
"@urql/core": ">=1.10.8",
"@urql/exchange-populate": ">=0.1.4",
"@urql/core": ">=1.10.9",
"@urql/exchange-populate": ">=0.1.5",
"wonka": "^4.0.9"

@@ -64,0 +64,0 @@ },

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