@urql/exchange-graphcache
Advanced tools
Comparing version 3.3.1 to 3.3.2
# @urql/exchange-graphcache | ||
## 3.3.2 | ||
### Patch Changes | ||
- Update `cache` methods, for instance `cache.resolve`, to consistently accept the `parent` argument from `resolvers` and `updates` and alias it to the parent's key (which is usually found on `info.parentKey`). This usage of `cache.resolve(parent, ...)` was intuitive and is now supported as expected, by [@kitten](https://github.com/kitten) (See [#1208](https://github.com/FormidableLabs/urql/pull/1208)) | ||
## 3.3.1 | ||
@@ -4,0 +10,0 @@ |
@@ -12,2 +12,3 @@ import { FieldNode } from 'graphql'; | ||
parentFieldKey: string; | ||
parent: Data; | ||
fieldName: string; | ||
@@ -17,4 +18,7 @@ partial: boolean; | ||
} | ||
export declare const contextRef: { | ||
current: Context | null; | ||
}; | ||
export declare const makeContext: (store: Store, variables: Variables, fragments: Fragments, typename: string, entityKey: string, optimistic?: boolean | undefined) => Context; | ||
export declare const updateContext: (ctx: Context, typename: string, entityKey: string, fieldKey: string, fieldName: string) => void; | ||
export declare const updateContext: (ctx: Context, data: Data, typename: string, entityKey: string, fieldKey: string, fieldName: string) => void; | ||
interface SelectionIterator { | ||
@@ -21,0 +25,0 @@ (): FieldNode | undefined; |
@@ -31,6 +31,6 @@ import { DocumentNode, IntrospectionQuery } from 'graphql'; | ||
keyOfField: (fieldName: string, args?: Variables | null | undefined) => string; | ||
keyOfEntity(data: Data): string | null; | ||
keyOfEntity(data: Data | null | string): string | null; | ||
resolveFieldByKey(entity: Data | string | null, fieldKey: string): DataField; | ||
resolve(entity: Data | string | null, field: string, args?: Variables): DataField; | ||
invalidate(entity: Data | string, field?: string, args?: Variables): void; | ||
invalidate(entity: Data | string | null, field?: string, args?: Variables): void; | ||
inspectFields(entity: Data | string | null): FieldInfo[]; | ||
@@ -37,0 +37,0 @@ updateQuery<T = Data, V = Variables>(input: QueryInput<T, V>, updater: (data: T | null) => T | null): void; |
@@ -44,2 +44,3 @@ import { TypedDocumentNode } from '@urql/core'; | ||
export interface ResolveInfo { | ||
parent: Data; | ||
parentTypeName: string; | ||
@@ -60,3 +61,3 @@ parentKey: string; | ||
/** keyOfEntity() returns the key for an entity or null if it's unkeyable */ | ||
keyOfEntity(data: Data): string | null; | ||
keyOfEntity(data: Data | null | string): string | null; | ||
/** keyOfField() returns the key for a field */ | ||
@@ -71,3 +72,3 @@ keyOfField(fieldName: string, args?: Variables | null | undefined): string | null; | ||
/** invalidate() invalidates an entity or a specific field of an entity */ | ||
invalidate(entity: Data | string, fieldName?: string, args?: Variables): void; | ||
invalidate(entity: Data | string | null, fieldName?: string, args?: Variables): void; | ||
/** updateQuery() can be used to update the data of a given query using an updater function */ | ||
@@ -74,0 +75,0 @@ updateQuery<T = Data, V = Variables>(input: QueryInput<T, V>, updater: (data: T | null) => T | null): void; |
"use strict"; | ||
var _rollupPluginBabelHelpers = require("./7832a774.js"), core = require("@urql/core"), defaultPageInfo = { | ||
var core = require("@urql/core"), _rollupPluginBabelHelpers = require("./7832a774.js"), defaultPageInfo = { | ||
__typename: "PageInfo", | ||
@@ -5,0 +5,0 @@ endCursor: null, |
@@ -1,2 +0,2 @@ | ||
"use strict";var e=require("./1cc90026.min.js"),r=require("@urql/core"),n={__typename:"PageInfo",endCursor:null,startCursor:null,hasNextPage:!1,hasPreviousPage:!1},t=function(e){return"string"==typeof e?e:null},a=function(e,r,n){for(var t=new Set,a=0,s=r.length;a<s;a++){var o=e.resolve(r[a],"node");"string"==typeof o&&t.add(o)}for(r=r.slice(),a=0,s=n.length;a<s;a++){var i=e.resolve(o=n[a],"node");"string"!=typeof i||t.has(i)||(t.add(i),r.push(o))}return r},s=function(e,r){for(var n=new Set,t=0,a=e.length;t<a;t++){var s=e[t];"string"==typeof s&&n.add(s)}for(e=e.slice(),t=0,a=r.length;t<a;t++)"string"!=typeof(s=r[t])||n.has(s)||(n.add(s),e.push(s));return e},o=function(e,n){for(var t in n)if("first"!==t&&"last"!==t&&"after"!==t&&"before"!==t){if(!(t in e))return!1;var a=e[t],s=n[t];if(typeof a!=typeof s||"object"!=typeof a?a!==s:r.stringifyVariables(a)!==r.stringifyVariables(s))return!1}for(var o in e)if("first"!==o&&"last"!==o&&"after"!==o&&"before"!==o&&!(o in n))return!1;return!0},i=function(e,r,a){var s=t(e.resolveFieldByKey(r,a));if(!s)return null;a=e.resolve(s,"__typename"),r=e.resolve(s,"edges")||[];var o=e.resolve(s,"nodes")||[];if("string"!=typeof a)return null;a={__typename:a,edges:r,nodes:o,pageInfo:n};var i=e.resolve(s,"pageInfo");if("string"==typeof i){s=t(e.resolve(i,"__typename")),o=t(e.resolve(i,"endCursor"));var f=t(e.resolve(i,"startCursor")),l=e.resolve(i,"hasNextPage");i=e.resolve(i,"hasPreviousPage"),null===(s=a.pageInfo={__typename:"string"==typeof s?s:"PageInfo",hasNextPage:"boolean"==typeof l?l:!!o,hasPreviousPage:"boolean"==typeof i?i:!!f,endCursor:o,startCursor:f}).endCursor&&(o=r[r.length-1])&&(o=e.resolve(o,"cursor"),s.endCursor=t(o)),null===s.startCursor&&(r=r[0])&&(e=e.resolve(r,"cursor"),s.startCursor=t(e))}return a};exports.relayPagination=function(r){void 0===r&&(r={});var f=r.mergeMode||"inwards";return function(r,l,u,g){var d=g.fieldName,p=u.inspectFields(r=g.parentKey).filter((function(e){return e.fieldName===d})),v=p.length;if(0!==v){for(var y=null,c=[],m=[],h=[],_=[],P=e._extends({},n),C=0;C<v;C++){var b=p[C],I=b.fieldKey;if(null!==(b=b.arguments)&&o(l,b)&&null!==(I=i(u,r,I))){if("inwards"===f&&"number"==typeof b.last&&"number"==typeof b.first){P=I.edges.slice(0,b.first+1);var N=I.edges.slice(-b.last),x=I.nodes.slice(0,b.first+1);b=I.nodes.slice(-b.last),c=a(u,c,P),m=a(u,N,m),h=s(h,x),_=s(b,_),P=I.pageInfo}else b.after?(c=a(u,c,I.edges),h=s(h,I.nodes),P.endCursor=I.pageInfo.endCursor,P.hasNextPage=I.pageInfo.hasNextPage):b.before?(m=a(u,I.edges,m),_=s(I.nodes,_),P.startCursor=I.pageInfo.startCursor,P.hasPreviousPage=I.pageInfo.hasPreviousPage):("number"==typeof b.last?(m=a(u,m,I.edges),_=s(_,I.nodes)):(c=a(u,c,I.edges),h=s(h,I.nodes)),P=I.pageInfo);I.pageInfo.__typename!==P.__typename&&(P.__typename=I.pageInfo.__typename),y!==I.__typename&&(y=I.__typename)}}if("string"==typeof y){if(!t(u.resolve(r,d,l))){if(!g.store.schema)return;g.partial=!0}return{__typename:y,edges:"inwards"===f?a(u,c,m):a(u,m,c),nodes:"inwards"===f?s(h,_):s(_,h),pageInfo:{__typename:P.__typename,endCursor:P.endCursor,startCursor:P.startCursor,hasNextPage:P.hasNextPage,hasPreviousPage:P.hasPreviousPage}}}}}},exports.simplePagination=function(e){void 0===e&&(e={});var n=e.offsetArgument;void 0===n&&(n="skip");var t=e.limitArgument;void 0===t&&(t="limit");var a=e.mergeMode;void 0===a&&(a="after");var s=function(e,a){for(var s in a)if(s!==n&&s!==t){if(!(s in e))return!1;var o=e[s],i=a[s];if(typeof o!=typeof i||"object"!=typeof o?o!==i:r.stringifyVariables(o)!==r.stringifyVariables(i))return!1}for(var f in e)if(f!==n&&f!==t&&!(f in a))return!1;return!0};return function(e,r,t,o){var i=o.fieldName,f=t.inspectFields(e=o.parentKey).filter((function(e){return e.fieldName===i})),l=f.length;if(0!==l){for(var u=new Set,g=[],d=null,p=0;p<l;p++){var v=f[p],y=v.fieldKey;if(null!==(v=v.arguments)&&s(r,v)&&(y=t.resolveFieldByKey(e,y),v=v[n],null!==y&&0!==y.length&&"number"==typeof v)){for(var c=[],m=0;m<y.length;m++){var h=y[m];u.has(h)||(c.push(h),u.add(h))}g=(!d||v>d)==("after"===a)?g.concat(c):c.concat(g),d=v}}if(t.resolve(e,i,r))return g;if(o.store.schema)return o.partial=!0,g}}}; | ||
"use strict";var e=require("@urql/core"),r=require("./1cc90026.min.js"),n={__typename:"PageInfo",endCursor:null,startCursor:null,hasNextPage:!1,hasPreviousPage:!1},t=function(e){return"string"==typeof e?e:null},a=function(e,r,n){for(var t=new Set,a=0,s=r.length;a<s;a++){var o=e.resolve(r[a],"node");"string"==typeof o&&t.add(o)}for(r=r.slice(),a=0,s=n.length;a<s;a++){var i=e.resolve(o=n[a],"node");"string"!=typeof i||t.has(i)||(t.add(i),r.push(o))}return r},s=function(e,r){for(var n=new Set,t=0,a=e.length;t<a;t++){var s=e[t];"string"==typeof s&&n.add(s)}for(e=e.slice(),t=0,a=r.length;t<a;t++)"string"!=typeof(s=r[t])||n.has(s)||(n.add(s),e.push(s));return e},o=function(r,n){for(var t in n)if("first"!==t&&"last"!==t&&"after"!==t&&"before"!==t){if(!(t in r))return!1;var a=r[t],s=n[t];if(typeof a!=typeof s||"object"!=typeof a?a!==s:e.stringifyVariables(a)!==e.stringifyVariables(s))return!1}for(var o in r)if("first"!==o&&"last"!==o&&"after"!==o&&"before"!==o&&!(o in n))return!1;return!0},i=function(e,r,a){var s=t(e.resolveFieldByKey(r,a));if(!s)return null;a=e.resolve(s,"__typename"),r=e.resolve(s,"edges")||[];var o=e.resolve(s,"nodes")||[];if("string"!=typeof a)return null;a={__typename:a,edges:r,nodes:o,pageInfo:n};var i=e.resolve(s,"pageInfo");if("string"==typeof i){s=t(e.resolve(i,"__typename")),o=t(e.resolve(i,"endCursor"));var f=t(e.resolve(i,"startCursor")),l=e.resolve(i,"hasNextPage");i=e.resolve(i,"hasPreviousPage"),null===(s=a.pageInfo={__typename:"string"==typeof s?s:"PageInfo",hasNextPage:"boolean"==typeof l?l:!!o,hasPreviousPage:"boolean"==typeof i?i:!!f,endCursor:o,startCursor:f}).endCursor&&(o=r[r.length-1])&&(o=e.resolve(o,"cursor"),s.endCursor=t(o)),null===s.startCursor&&(r=r[0])&&(e=e.resolve(r,"cursor"),s.startCursor=t(e))}return a};exports.relayPagination=function(e){void 0===e&&(e={});var f=e.mergeMode||"inwards";return function(e,l,u,g){var d=g.fieldName,p=u.inspectFields(e=g.parentKey).filter((function(e){return e.fieldName===d})),v=p.length;if(0!==v){for(var y=null,c=[],m=[],h=[],_=[],P=r._extends({},n),C=0;C<v;C++){var b=p[C],I=b.fieldKey;if(null!==(b=b.arguments)&&o(l,b)&&null!==(I=i(u,e,I))){if("inwards"===f&&"number"==typeof b.last&&"number"==typeof b.first){P=I.edges.slice(0,b.first+1);var N=I.edges.slice(-b.last),x=I.nodes.slice(0,b.first+1);b=I.nodes.slice(-b.last),c=a(u,c,P),m=a(u,N,m),h=s(h,x),_=s(b,_),P=I.pageInfo}else b.after?(c=a(u,c,I.edges),h=s(h,I.nodes),P.endCursor=I.pageInfo.endCursor,P.hasNextPage=I.pageInfo.hasNextPage):b.before?(m=a(u,I.edges,m),_=s(I.nodes,_),P.startCursor=I.pageInfo.startCursor,P.hasPreviousPage=I.pageInfo.hasPreviousPage):("number"==typeof b.last?(m=a(u,m,I.edges),_=s(_,I.nodes)):(c=a(u,c,I.edges),h=s(h,I.nodes)),P=I.pageInfo);I.pageInfo.__typename!==P.__typename&&(P.__typename=I.pageInfo.__typename),y!==I.__typename&&(y=I.__typename)}}if("string"==typeof y){if(!t(u.resolve(e,d,l))){if(!g.store.schema)return;g.partial=!0}return{__typename:y,edges:"inwards"===f?a(u,c,m):a(u,m,c),nodes:"inwards"===f?s(h,_):s(_,h),pageInfo:{__typename:P.__typename,endCursor:P.endCursor,startCursor:P.startCursor,hasNextPage:P.hasNextPage,hasPreviousPage:P.hasPreviousPage}}}}}},exports.simplePagination=function(r){void 0===r&&(r={});var n=r.offsetArgument;void 0===n&&(n="skip");var t=r.limitArgument;void 0===t&&(t="limit");var a=r.mergeMode;void 0===a&&(a="after");var s=function(r,a){for(var s in a)if(s!==n&&s!==t){if(!(s in r))return!1;var o=r[s],i=a[s];if(typeof o!=typeof i||"object"!=typeof o?o!==i:e.stringifyVariables(o)!==e.stringifyVariables(i))return!1}for(var f in r)if(f!==n&&f!==t&&!(f in a))return!1;return!0};return function(e,r,t,o){var i=o.fieldName,f=t.inspectFields(e=o.parentKey).filter((function(e){return e.fieldName===i})),l=f.length;if(0!==l){for(var u=new Set,g=[],d=null,p=0;p<l;p++){var v=f[p],y=v.fieldKey;if(null!==(v=v.arguments)&&s(r,v)&&(y=t.resolveFieldByKey(e,y),v=v[n],null!==y&&0!==y.length&&"number"==typeof v)){for(var c=[],m=0;m<y.length;m++){var h=y[m];u.has(h)||(c.push(h),u.add(h))}g=(!d||v>d)==("after"===a)?g.concat(c):c.concat(g),d=v}}if(t.resolve(e,i,r))return g;if(o.store.schema)return o.partial=!0,g}}}; | ||
//# sourceMappingURL=urql-exchange-graphcache-extras.min.js.map |
@@ -84,3 +84,3 @@ "use strict"; | ||
var query, read, readRoot, readRootField, readFragment, readSelection, resolveResolverResult, resolveLink, isDataOrKey, addCacheOutcome, toRequestPolicy, cacheExchange, isOptimisticMutation, isOfflineError, offlineExchange, _rollupPluginBabelHelpers = require("./7832a774.js"), graphql = require("graphql"), core = require("@urql/core"), wonka = require("wonka"), getName = function(a) { | ||
var query, read, readRoot, readRootField, readFragment, readSelection, resolveResolverResult, resolveLink, isDataOrKey, addCacheOutcome, toRequestPolicy, cacheExchange, isOptimisticMutation, isOfflineError, offlineExchange, graphql = require("graphql"), core = require("@urql/core"), _rollupPluginBabelHelpers = require("./7832a774.js"), wonka = require("wonka"), getName = function(a) { | ||
return a.name.value; | ||
@@ -445,2 +445,4 @@ }, getFragmentTypeName = function(a) { | ||
a.storage = b; | ||
}, contextRef = { | ||
current: null | ||
}, makeContext = function(a, b, c, d, e, f) { | ||
@@ -451,2 +453,5 @@ return { | ||
fragments: c, | ||
parent: { | ||
__typename: d | ||
}, | ||
parentTypeName: d, | ||
@@ -459,7 +464,9 @@ parentKey: e, | ||
}; | ||
}, updateContext = function(a, b, c, d, e) { | ||
a.parentTypeName = b; | ||
a.parentKey = c; | ||
a.parentFieldKey = d; | ||
a.fieldName = e; | ||
}, updateContext = function(a, b, c, d, e, f) { | ||
contextRef.current = a; | ||
a.parent = b; | ||
a.parentTypeName = c; | ||
a.parentKey = d; | ||
a.parentFieldKey = e; | ||
a.fieldName = f; | ||
}, isFragmentHeuristicallyMatching = function(a, b, c, d) { | ||
@@ -574,3 +581,3 @@ if (!b) { | ||
} | ||
updateContext(a, g, g, e, k); | ||
updateContext(a, d, g, g, e, k); | ||
l = d[r] = ensureData(l(m || {}, a.store, a)); | ||
@@ -580,3 +587,3 @@ } | ||
writeLink(b || g, e, h)) : writeField(a, getSelectionSet(h), ensureData(l)) : b && !f && writeRecord(b || g, e, l); | ||
f && (updateContext(a, g, g, joinKeys(g, e), k), e = a.store.updates[g][k]) && (d[k] = l, | ||
f && (updateContext(a, d, g, g, joinKeys(g, e), k), e = a.store.updates[g][k]) && (d[k] = l, | ||
e(d, m || {}, a.store, a)); | ||
@@ -695,9 +702,16 @@ } | ||
Store.prototype.keyOfEntity = function(a) { | ||
var e, b = a.__typename, c = a.id, d = a._id; | ||
if (!b) { | ||
var b, c, d, e; | ||
if (null == a || "string" == typeof a) { | ||
return a || null; | ||
} | ||
c = a.id, d = a._id; | ||
if (!(b = a.__typename)) { | ||
return null; | ||
} | ||
if (void 0 !== this.rootNames[b]) { | ||
if (this.rootNames[b]) { | ||
return b; | ||
} | ||
if (contextRef.current && a === contextRef.current.parent) { | ||
return contextRef.current.parentKey; | ||
} | ||
this.keys[b] ? e = this.keys[b](a) : null != c ? e = "" + c : null != d && (e = "" + d); | ||
@@ -708,3 +722,3 @@ return e ? b + ":" + e : null; | ||
Store.prototype.resolveFieldByKey = function(a, b) { | ||
if (null === (a = null !== a && "string" != typeof a ? this.keyOfEntity(a) : a)) { | ||
if (!(a = this.keyOfEntity(a))) { | ||
return null; | ||
@@ -721,3 +735,3 @@ } | ||
Store.prototype.invalidate = function(a, b, c) { | ||
var d = "string" == typeof a ? a : this.keyOfEntity(a); | ||
var d = this.keyOfEntity(a); | ||
invariant(d, "production" !== process.env.NODE_ENV ? "object" == "Can't generate a key for invalidate(...).\nYou have to pass an id or _id field or create a custom `keys` field for `" + typeof a ? a.__typename : a + "`." : "", 19); | ||
@@ -728,3 +742,3 @@ invalidateEntity(d, b, c); | ||
Store.prototype.inspectFields = function(a) { | ||
return null !== (a = null !== a && "string" != typeof a ? this.keyOfEntity(a) : a) ? inspectFields(a) : []; | ||
return (a = this.keyOfEntity(a)) ? inspectFields(a) : []; | ||
}; | ||
@@ -797,5 +811,3 @@ | ||
"string" == typeof c || c.__typename || (c.__typename = f); | ||
if (!(c = "string" != typeof c ? a.keyOfEntity(_rollupPluginBabelHelpers._extends({}, { | ||
__typename: f | ||
}, c)) : c)) { | ||
if (!(c = a.keyOfEntity(c))) { | ||
return "production" !== process.env.NODE_ENV && warn("Can't generate a key for readFragment(...).\nYou have to pass an `id` or `_id` field or create a custom `keys` config for `" + f + "`.", 7), | ||
@@ -828,3 +840,3 @@ null; | ||
} else if ("read" === getCurrentOperation() && v && "function" == typeof v[l]) { | ||
if (updateContext(a, b, h, t, l), void 0 !== n && (d[p] = n), q = v[l](d, w || {}, f, a), | ||
if (updateContext(a, d, b, h, t, l), void 0 !== n && (d[p] = n), q = v[l](d, w || {}, f, a), | ||
k.selectionSet && (q = resolveResolverResult(a, b, l, t, getSelectionSet(k), d[p], q)), | ||
@@ -918,3 +930,3 @@ f.schema && null === q && !isFieldNullable(f.schema, b, l)) { | ||
function f(a) { | ||
var b = a.operation, c = a.outcome, e = a.dependencies, d = { | ||
var b = a.operation, c = a.outcome, d = a.dependencies, e = { | ||
operation: addCacheOutcome(b, c), | ||
@@ -926,3 +938,3 @@ data: a.data, | ||
if ("cache-and-network" === b.context.requestPolicy || "cache-first" === b.context.requestPolicy && "partial" === c) { | ||
d.stale = !0, B(e) ? "cache-and-network" === b.context.requestPolicy && q.add(b.key) : l.reexecuteOperation(toRequestPolicy(b, "network-only")); | ||
e.stale = !0, B(d) ? "cache-and-network" === b.context.requestPolicy && q.add(b.key) : l.reexecuteOperation(toRequestPolicy(b, "network-only")); | ||
} | ||
@@ -934,7 +946,7 @@ "production" !== process.env.NODE_ENV && w({ | ||
data: { | ||
value: d | ||
value: e | ||
}, | ||
source: "cacheExchange" | ||
}); | ||
return d; | ||
return e; | ||
} | ||
@@ -941,0 +953,0 @@ function g(a) { |
@@ -1,2 +0,2 @@ | ||
"use strict";var e=require("./1cc90026.min.js"),t=require("graphql"),r=require("@urql/core"),n=require("wonka"),i=function(e){return e.name.value},o=function(e){return e.typeCondition.name.value},a=function(e){return e.alias?e.alias.value:i(e)},u=function(e){return e.selectionSet?e.selectionSet.selections:[]},s=function(e){return e.typeCondition?i(e.typeCondition):null},f=function(e){return e.kind===t.Kind.FIELD},c=function(e){return e.kind===t.Kind.INLINE_FRAGMENT},l=function(e,r){var n={},o=0;if(e.arguments&&e.arguments.length)for(var a=0,u=e.arguments.length;a<u;a++){var s=e.arguments[a],f=t.valueFromASTUntyped(s.value,r);null!=f&&(n[i(s)]=f,o++)}return 0<o?n:null},d=function(e,t){if(t&&e.variableDefinitions){for(var r={},n=0,o=e.variableDefinitions.length;n<o;n++){var a=i(e.variableDefinitions[n].variable);r[a]=t[a]}return r}},p=function(e,r){var n={};if(!r)return n;if(e.variableDefinitions)for(var o=0,a=e.variableDefinitions.length;o<a;o++){var u=e.variableDefinitions[o],s=i(u.variable);n[s]=void 0===r[s]&&u.defaultValue?t.valueFromASTUntyped(u.defaultValue,r):r[s]}for(var f in r)f in n||(n[f]=r[f]);return n};function y(e,t,r){if(!e)throw(e=Error((t||"Minfied Error #"+r+"\n")+"\nhttps://bit.ly/2XbVrpR#"+r)).name="Graphcache Error",e}new Set;var v=function(e){for(var r=0;r<e.definitions.length;r++)if(e.definitions[r].kind===t.Kind.OPERATION_DEFINITION)return e.definitions[r];y(!1,"",1)},m=function(e){for(var r={},n=0;n<e.definitions.length;n++){var o=e.definitions[n];o.kind===t.Kind.FRAGMENT_DEFINITION&&(r[i(o)]=o)}return r},h=function(e,r){var n=e.directives;if(!n)return!0;for(var o=0,a=n.length;o<a;o++){var u=n[o];if(("include"===(e=i(u))||"skip"===e)&&u.arguments&&u.arguments[0]&&"if"===i(u.arguments[0]))return r=t.valueFromASTUntyped(u.arguments[0].value,r),"include"===e?!!r:!r}return!0};function k(e){for(var t={},r=0;r<e.length;r++)t[e[r].name]=e[r];return t}var g=/^__/,O=function(e,t,r){return!!g.test(r)||!!(e=_(e,t,r))&&"NON_NULL"!==e.type.kind},b=function(e,t,r){return!!(e=_(e,t,r))&&"LIST"===(e="NON_NULL"===e.type.kind?e.type.ofType:e.type).kind&&"NON_NULL"!==e.ofType.kind},q=function(e,t,r){return!!r&&(!(t=s(t))||r===t||(e.types[t]&&"OBJECT"===e.types[t].kind?t===r:(function(e,t){y(e.types[t]&&("INTERFACE"===e.types[t].kind||"UNION"===e.types[t].kind),"",5)}(e,t),w(e,r),e.isSubType(t,r))))},_=function(e,t,r){return w(e,t),e.types[t].fields[r]};function w(e,t){y(e.types[t]&&"OBJECT"===e.types[t].kind,"",3)}var x=function(e,t){return t?e+"("+r.stringifyVariables(t)+")":e},N=function(e,t){return e+"."+t},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){var t=e.indexOf(".");return{entityKey:e.slice(0,t).replace(/%2e/g,"."),fieldKey:e=e.slice(t+1)}},S=function(){return Object.create(null)},T=null,F=null,A=null,L=null,D=!1,M=function(){return{optimistic:S(),base:new Map}},I=function(e,t,r,n){T=e,F=t,A=S(),D=!!n,r?n||0<t.optimisticOrder.length?(n||t.commutativeKeys.has(r)?n&&t.commutativeKeys.delete(r):ee(t,r),L=r,te(t,r)):(L=null,ne(t,r)):L=null},C=function(){var e=F,t=L;if(D=!1,L=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]);)ae(e.optimisticOrder[t]);A=F=T=null,e.defer||(e.defer=!0,Promise.resolve().then((function(){I("read",e,null),z(),se(),C(),e.defer=!1})))},P=function(e,t,r){I("read",e,t,r),C()},R=function(){return y(null!==A,"",2),A},U=function(e,t,r,n){var i=(e=L?e.optimistic[L]:e.base).get(t);void 0===i&&e.set(t,i=S()),void 0!==n||L?i[r]=n:delete i[r]},J=function(e,t,r){for(var n,i=0,o=F.optimisticOrder.length;i<o;i++){var a=F.optimisticOrder[i],u=e.optimistic[a];if(u&&(!D||"write"===T||F.commutativeKeys.has(a))&&void 0!==(n=u.get(t))&&r in n)return n[r]}return void 0!==(n=e.base.get(t))?n[r]:void 0},j=function(e,t,r,n){var i=void 0!==t[r]?t[r]:0;t=t[r]=i+n|0,void 0!==e&&(0>=t?e.add(r):0>=i&&0<t&&e.delete(r))},B=function(e,t,r,n){if("string"==typeof r)j(e,t,r,n);else if(Array.isArray(r))for(var i=0,o=r.length;i<o;i++){var a=r[i];a&&j(e,t,a,n)}},V=function(e,t,r){if(void 0!==r)for(var n in r)t.has(n)||(e.push(E(n)),t.add(n))},Q=function(e,t,r,n){V(e,t,n.base.get(r));for(var i=0,o=F.optimisticOrder.length;i<o;i++){var a=n.optimistic[F.optimisticOrder[i]];void 0!==a&&V(e,t,a.get(r))}};function G(e,t,r){if(0<(F.refCount[e]||0))r.delete(e);else{for(var n in F.refLock){if(0<((t=F.refLock[n])[e]||0))return;delete t[e]}if(delete F.refCount[e],r.delete(e),F.records.base.delete(e),n=F.links.base.get(e))for(var i in F.links.base.delete(e),n)B(r,F.refCount,n[i],-1)}}var z=function(){F.gc.forEach(G)},X=function(e,t){"__typename"!==t&&(e!==F.queryRootKey?A[e]=!0:void 0!==t&&(A[N(e,t)]=!0))},H=function(e,t){!D&&F.storage&&F.persist.add(function(e,t){return e.replace(/\./g,"%2e")+"."+t}(e,t))},W=function(e,t){return X(e,t),J(F.records,e,t)},Y=function(e,t){return X(e,t),J(F.links,e,t)},Z=function(e,t,r){X(e,t),H(e,t),U(F.records,e,t,r)},$=function(e,t,r){var n=F;if(L)var i=n.refLock[L]||(n.refLock[L]=S()),o=n.links.optimistic[L];else{i=n.refCount,o=n.links.base;var a=n.gc}o=(o=o&&o.get(e))&&o[t],X(e,t),H(e,t),U(n.links,e,t,r),B(a,i,o,-1),B(a,i,r,1)},ee=function(e,t){var r=e.optimisticOrder.indexOf(t);-1===r?e.optimisticOrder.unshift(t):e.commutativeKeys.has(t)||(re(e,t),e.optimisticOrder.splice(r,1),e.optimisticOrder.unshift(t)),e.commutativeKeys.add(t)},te=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.refLock[t]||(e.refLock[t]=S(),e.links.optimistic[t]=new Map,e.records.optimistic[t]=new Map)},re=function(e,t){e.refLock[t]&&(delete e.refLock[t],delete e.records.optimistic[t],delete e.links.optimistic[t])},ne=function(e,t){var r=e.optimisticOrder.indexOf(t);-1<r&&(e.optimisticOrder.splice(r,1),e.commutativeKeys.delete(t)),re(e,t)};function ie(e,t){for(var r in e)$(t,r,e[r])}function oe(e,t){for(var r in e)Z(t,r,e[r])}var ae=function(e){var t=A;A=S();var r=F.links.optimistic[e];r&&r.forEach(ie),(r=F.records.optimistic[e])&&r.forEach(oe),A=t,ne(F,e)},ue=function(e){var t=F.links,r=F.records,n=[],i=new Set;return X(e),Q(n,i,e,t),Q(n,i,e,r),n},se=function(){if(F.storage){D=!0,T="read";var e=S();F.persist.forEach((function(t){var n,i=K(t),o=i.entityKey;e[t]=void 0!==(n=Y(o,i=i.fieldKey))?":"+r.stringifyVariables(n):void 0!==(n=W(o,i))?r.stringifyVariables(n):void 0})),D=!1,F.storage.writeData(e),F.persist.clear()}},fe=function(e,t,r,n,i,o){return{store:e,variables:t,fragments:r,parentTypeName:n,parentKey:i,parentFieldKey:"",fieldName:"",partial:!1,optimistic:!!o}},ce=function(e,t,r,n,i){e.parentTypeName=t,e.parentKey=r,e.parentFieldKey=n,e.fieldName=i},le=function(e,t,r,n){if(!t)return!1;var o=s(e);return!o||t===o||!u(e).some((function(e){return!!f(e)&&(e=x(i(e),l(e,n)),!function(e,t){return void 0!==W(e,t)||void 0!==Y(e,t)}(r,e))}))},de=function(e,t,r,n){var o,a=0;return function(){if(void 0!==o){var s=o();if(void 0!==s)return s;o=void 0}for(;a<r.length;)if(s=r[a++],h(s,n.variables)){if(f(s))return s;if(void 0!==(s=c(s)?s:n.fragments[i(s)])&&(n.store.schema?q(n.store.schema,s,e):le(s,e,t,n.variables)))return(o=de(e,t,u(s),n))()}}},pe=function(e){return void 0===e?null:e},ye=function(e,t,r,n){return I("write",e.data,n||null),e=ve(e,t,r),C(),e},ve=function(e,t,r){var n=v(t.query),i={data:r,dependencies:R()},o=e.rootFields[n.operation];return e=fe(e,p(n,t.variables),m(t.query),o,o),me(e,o,u(n),r),i},me=function(e,t,r,n){var o=t===e.store.rootFields.query,s=!o&&!!e.store.rootNames[t],f=s||o?t:n.__typename;if(f){s||o||!t||Z(t,"__typename",f),r=de(f,t||f,r,e);for(var c;c=r();){o=i(c);var d=l(c,e.variables),p=x(o,d),y=a(c),v=n[y];if("__typename"!==o){if(e.optimistic&&s){if(!(v=e.store.optimisticMutations[o]))continue;ce(e,f,f,p,o),v=n[y]=pe(v(d||{},e.store,e))}c.selectionSet?t&&!s?(y=N(t,p),c=he(e,u(c),pe(v),y),$(t||f,p,c)):he(e,u(c),pe(v)):t&&!s&&Z(t||f,p,v),s&&(ce(e,f,f,N(f,p),o),p=e.store.updates[f][o])&&(n[o]=v,p(n,d||{},e.store,e))}}}},he=function(e,t,r,n){if(Array.isArray(r)){for(var i=Array(r.length),o=0,a=r.length;o<a;o++){var u=r[o],s=n?N(n,""+o):void 0;u=he(e,t,u,s),i[o]=u}return i}return null===r?null:(n=e.store.keyOfEntity(r)||n,me(e,n,t,r),n||null)},ke=function(e){var t,r;this.keyOfField=x,e||(e={}),this.resolvers=e.resolvers||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{};var n="Query",i="Mutation",o="Subscription";if(e.schema){var a=this.schema=function(e){function t(e){return{name:e.name,type:e.type,args:n(e.args)}}e=e.__schema;for(var r={},n=k,i=function(e){switch(e.kind){case"OBJECT":case"INTERFACE":return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map(t))};case"UNION":return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},o=0;o<e.types.length;o++){var a=e.types[o];if(a&&a.name){var u=i(a);u&&(r[a.name]=u)}}return{query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:r,isSubType:function(e,t){var n=r[e],i=r[t];return!!(n&&i&&("UNION"===n.kind?n.types[t]:"OBJECT"!==n.kind&&"OBJECT"===i.kind?i.interfaces[e]:e===t))}}}(e.schema);n=a.query||n,i=a.mutation||i,o=a.subscription||o}this.updates=((t={})[i]=e.updates&&e.updates.Mutation||{},t[o]=e.updates&&e.updates.Subscription||{},t),this.rootFields={query:n,mutation:i,subscription:o},this.rootNames=((r={})[n]="query",r[i]="mutation",r[o]="subscription",r),this.data=function(e){return{defer:!1,gc:new Set,persist:new Set,queryRootKey:e,refCount:S(),refLock:S(),links:M(),records:M(),commutativeKeys:new Set,optimisticOrder:[],storage:null}}(n)};ke.prototype.keyOfEntity=function(e){var t,r=e.__typename,n=e.id,i=e._id;return r?void 0!==this.rootNames[r]?r:(this.keys[r]?t=this.keys[r](e):null!=n?t=""+n:null!=i&&(t=""+i),t?r+":"+t:null):null},ke.prototype.resolveFieldByKey=function(e,t){if(null===(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e))return null;var r=W(e,t);return void 0!==r?r:(t=Y(e,t))?t:null},ke.prototype.resolve=function(e,t,r){return this.resolveFieldByKey(e,x(t,r))},ke.prototype.invalidate=function(e,t,r){y(e="string"==typeof e?e:this.keyOfEntity(e),"",19),function(e,t,r){t=t?[{fieldKey:x(t,r)}]:ue(e),r=0;for(var n=t.length;r<n;r++){var i=t[r].fieldKey;void 0!==Y(e,i)?$(e,i,void 0):Z(e,i,void 0)}}(e,t,r)},ke.prototype.inspectFields=function(e){return null!==(e=null!==e&&"string"!=typeof e?this.keyOfEntity(e):e)?ue(e):[]},ke.prototype.updateQuery=function(e,t){(e=r.createRequest(e.query,e.variables)).query=r.formatDocument(e.query),null!==(t=t(this.readQuery(e)))&&ve(this,e,t)},ke.prototype.readQuery=function(e){return(e=r.createRequest(e.query,e.variables)).query=r.formatDocument(e.query),Oe(this,e).data},ke.prototype.readFragment=function(e,t,n){return _e(this,r.formatDocument(e),t,n)},ke.prototype.writeFragment=function(t,n,i){!function(t,r,n,i){r=m(r);var a=Object.keys(r);if(a=r[a[0]]){var s=o(a);n=e._extends({},{__typename:s},n);var f=t.keyOfEntity(n);f&&(t=fe(t,i||{},r,s,f),me(t,f,u(a),n))}}(this,r.formatDocument(t),n,i)};var ge=function(e,t,r){return I("read",e.data,null),e=Oe(e,t,r),C(),e},Oe=function(e,t,r){var n=v(t.query),i=e.rootFields[n.operation],o=u(n);return r=i!==(e=fe(e,p(n,t.variables),m(t.query),i,i)).store.rootFields.query?be(e,i,o,r||{}):we(e,i,o,{}),{dependencies:R(),partial:e.partial||!r,data:r||null}},be=function(e,t,r,n){if("string"!=typeof n.__typename)return n;t=de(t,t,r,e),(r={}).__typename=n.__typename;for(var i;i=t();){var o=a(i),s=n[o];i.selectionSet&&null!==s?(s=pe(s),r[o]=qe(e,u(i),s)):r[o]=s}return r},qe=function(e,t,r){if(Array.isArray(r)){for(var n=Array(r.length),i=0,o=r.length;i<o;i++)n[i]=qe(e,t,r[i]);return n}return null===r?null:null!==(n=e.store.keyOfEntity(r))?void 0===(e=we(e,n,t,{}))?null:e:be(e,r.__typename,t,r)},_e=function(t,r,n,i){r=m(r);var a=Object.keys(r);if(!(a=r[a[0]]))return null;var s=o(a);return"string"==typeof n||n.__typename||(n.__typename=s),(n="string"!=typeof n?t.keyOfEntity(e._extends({},{__typename:s},n)):n)?(t=fe(t,i||{},r,s,n),we(t,n,u(a),{})||null):null},we=function(e,t,r,n,o){var s=e.store,f=t===s.rootFields.query,c=o&&s.keyOfEntity(o)||t;if("string"==typeof(t=f?t:W(c,"__typename")||o&&o.__typename)&&(!o||t===o.__typename)){r=de(t,c,r,e);for(var d,p=!1,v=!1;void 0!==(d=r());){var m=i(d),h=l(d,e.variables),k=a(d),g=x(m,h),b=N(c,g),q=W(c,g),_=o?o[m]:void 0,w=s.resolvers[t],E=void 0;if("__typename"===m)n[k]=t;else{if(void 0!==_&&void 0===d.selectionSet)E=_;else if("read"===(y(null!==T,"",2),T)&&w&&"function"==typeof w[m]){if(ce(e,t,c,b,m),void 0!==q&&(n[k]=q),E=w[m](n,h||{},s,e),d.selectionSet&&(E=xe(e,t,m,b,u(d),n[k],E)),s.schema&&null===E&&!O(s.schema,t,m))return}else d.selectionSet?void 0!==_?E=xe(e,t,m,b,u(d),n[k],_):void 0!==(h=Y(c,g))?E=Ne(e,h,t,m,u(d),n[k]):"object"==typeof q&&null!==q&&(E=q):E=q;if(void 0===E&&s.schema&&O(s.schema,t,m))v=!0,n[k]=null;else{if(void 0===E)return;p=!0,n[k]=E}}}return v&&(e.partial=!0),f&&v&&!p?void 0:n}},xe=function(e,t,r,n,i,o,a){if(Array.isArray(a)){var u=e.store;u=!u.schema||b(u.schema,t,r);for(var s=Array(a.length),f=0,c=a.length;f<c;f++){var l=xe(e,t,r,N(n,""+f),i,null!=o?o[f]:void 0,a[f]);if(void 0===l&&!u)return;s[f]=void 0!==l?l:null}return s}return null==a?a:null===o?null:Ee(a)?(t=o||{},"string"==typeof a?we(e,a,i,t):we(e,n,i,t,a)):void 0},Ne=function(e,t,r,n,i,o){if(Array.isArray(t)){var a=e.store;a=a.schema&&b(a.schema,r,n);for(var u=Array(t.length),s=0,f=t.length;s<f;s++){var c=Ne(e,t[s],r,n,i,null!=o?o[s]:void 0);if(void 0===c&&!a)return;u[s]=void 0!==c?c:null}return u}return null===t||null===o?null:we(e,t,i,o||{})},Ee=function(e){return"string"==typeof e||"object"==typeof e&&"string"==typeof e.__typename},Ke=function(t,n){return r.makeOperation(t.kind,t,e._extends({},t.context,{meta:e._extends({},t.context.meta,{cacheOutcome:n})}))},Se=function(t,n){return r.makeOperation(t.kind,t,e._extends({},t.context,{requestPolicy:n}))};function Te(e){return n.fromArray(e[0])}function Fe(e,t){return e.push(t),e}function Ae(e){return"query"===e.kind&&"network-only"!==e.context.requestPolicy}function Le(e){return"query"!==e.kind||"network-only"===e.context.requestPolicy}function De(e){return"miss"!==e.outcome||"cache-only"===e.operation.context.requestPolicy}var Me=function(e){return function(t){function i(e){return Ke(e.operation,"miss")}function o(e){return"miss"===e.outcome&&"cache-only"!==e.operation.context.requestPolicy&&!E(e.dependencies)}function a(e){var t=e.operation,r=e.outcome,n=e.dependencies;return e={operation:Ke(t,r),data:e.data,error:e.error,extensions:e.extensions},("cache-and-network"===t.context.requestPolicy||"cache-first"===t.context.requestPolicy&&"partial"===r)&&(e.stale=!0,E(n)?"cache-and-network"===t.context.requestPolicy&&x.add(t.key):g.reexecuteOperation(Se(t,"network-only"))),e}function s(e){var t=new Set,r=M(e,t);return F(e.operation,t),r}function f(e){return!b.has(e.operation.key)}function c(e){if(q.push(e)<b.size)return n.empty;for(var t=0;t<q.length;t++)ee(O.data,q[t].operation.key);for(var r in w)delete w[r];t=[],r=new Set;for(var i;i=q.shift();)t.push(M(i,r));return F(e.operation,r),n.fromArray(t)}function l(e){return b.has(e.operation.key)}var h,k=t.forward,g=t.client,O=new ke(e);e&&e.storage&&(h=e.storage.readData().then((function(t){!function(e,t,r){for(var n in I("write",e,null),r){var i=r[n];if(void 0!==i){var o=K(n),a=o.entityKey;o=o.fieldKey,":"===i[0]?$(a,o,JSON.parse(i.slice(1))):Z(a,o,JSON.parse(i))}}C(),e.storage=t}(O.data,e.storage,t)})));var b=new Map,q=[],_=new Map,w=S(),x=new Set,N=S(),E=function(e){for(var t in e)if(w[t])return!0;return!1},T=function(e,t){if(t)for(var r in t)if(t=N[r]){N[r]=[];for(var n=0,i=t.length;n<i;n++)e.add(t[n])}},F=function(e,t){t.forEach((function(t){if(t!==e.key){var r=_.get(t);if(r){_.delete(t);var n="cache-first";x.has(t)&&(x.delete(t),n="cache-and-network"),g.reexecuteOperation(Se(r,n))}}}))},A=function(e){if("query"===e.kind)ee(O.data,e.key);else if("teardown"===e.kind)_.delete(e.key),P(O.data,e.key);else if("mutation"===e.kind&&"network-only"!==e.context.requestPolicy){var t=function(e,t,r){I("write",e.data,r,!0),r=v(t.query);var n={data:{},dependencies:R()},i=e.rootFields[r.operation];return y(i===e.rootFields.mutation,"",10),e=fe(e,p(r,t.variables),m(t.query),i,i,!0),me(e,i,u(r),n.data),C(),n}(O,e,e.key).dependencies;if(!function(e){for(var t in e)return!1;return!0}(t)){for(var n in t)w[n]=!0;b.set(e.key,t),n=new Set,T(n,t),F(e,n)}}return r.makeOperation(e.kind,{key:e.key,query:r.formatDocument(e.query),variables:e.variables?d(v(e.query),e.variables):e.variables},e.context)},L=function(e,t){for(var r in t)(N[r]||(N[r]=[])).push(e.key),_.set(e.key,e)},D=function(e){var t=ge(O,e),r=t.data?t.partial?"partial":"hit":"miss";return L(e,t.dependencies),{outcome:r,operation:e,data:t.data,dependencies:t.dependencies}},M=function(e,t){var r=e.operation,n=e.error,i=e.extensions,o=r.key;if("mutation"===r.kind){var a=b.get(o);T(t,a),b.delete(o)}else ee(O.data,r.key);if(e.data){if(o=ye(O,r,e.data,o).dependencies,T(t,o),o=ge(O,r,e.data),e.data=o.data,"query"===r.kind){var u=o.dependencies;T(t,u)}}else P(O.data,r.key);return u&&L(e.operation,u),{data:e.data,error:n,extensions:i,operation:r}};return function(e){e=n.share(e);var t=h?n.mergeMap(Te)(n.take(1)(n.combine(n.scan(Fe,[])(e),n.fromPromise(h)))):n.empty;t=n.share(n.concat([t,e])),e=n.share(n.map(D)(n.filter(Ae)(t))),t=n.filter(Le)(t);var r=n.map(i)(n.filter(o)(e));return e=n.map(a)(n.filter(De)(e)),r=n.share(k(n.map(A)(n.merge([t,r])))),t=n.map(s)(n.filter(f)(r)),r=n.mergeMap(c)(n.filter(l)(r)),n.merge([t,r,e])}}},Ie=function(e){return e&&e.networkError&&!e.response&&("undefined"!=typeof navigator&&!1===navigator.onLine||/request failed|failed to fetch|network\s?error/i.test(e.networkError.message))};exports.Store=ke,exports.cacheExchange=Me,exports.offlineExchange=function(e){return function(o){function a(e){return"mutation"!==e.operation.kind||!Ie(e.error)||!function(e,t){var r,n=t.variables||S(),o=m(t.query);for(t=[].concat(u(v(t.query)));r=t.pop();)if(h(r,n))if(f(r)){if(e[i(r)])return!0}else(r=c(r)?r:o[i(r)])&&t.push.apply(t,u(r));return!1}(O,e.operation)||(b.push(e.operation),q(),!1)}function s(e){return"query"!==e.operation.kind||!Ie(e.error)||(g(Se(e.operation,"cache-only")),b.push(e.operation),!1)}var l=e.storage;if(l&&l.onOnline&&l.readMetadata&&l.writeMetadata){var d=o.forward,p=o.client;o=o.dispatchDebug;var y=n.makeSubject(),k=y.source,g=y.next,O=e.optimistic||{},b=[],q=function(){for(var e=[],r=0;r<b.length;r++){var n=b[r];"mutation"===n.kind&&e.push({query:t.print(n.query),variables:n.variables})}l.writeMetadata(e)},_=!1,w=function(){if(!_){_=!0;for(var e=0;e<b.length;e++){var t=b[e];"mutation"===t.kind&&g(r.makeOperation("teardown",t))}for(e=0;e<b.length;e++)p.reexecuteOperation(b[e]);b.length=0,_=!1,q()}};l.onOnline(w),l.readMetadata().then((function(e){if(e){for(var t=0;t<e.length;t++)b.push(p.createRequestOperation("mutation",r.createRequest(e[t].query,e[t].variables)));w()}}));var x=Me(e)({client:p,dispatchDebug:o,forward:function(e){return n.filter(a)(d(e))}});return function(e){return e=n.share(e),e=n.merge([k,e]),n.filter(s)(x(e))}}return Me(e)(o)}},exports.query=ge,exports.write=ye; | ||
"use strict";var e=require("graphql"),t=require("@urql/core"),r=require("./1cc90026.min.js"),n=require("wonka"),i=function(e){return e.name.value},o=function(e){return e.typeCondition.name.value},a=function(e){return e.alias?e.alias.value:i(e)},u=function(e){return e.selectionSet?e.selectionSet.selections:[]},s=function(e){return e.typeCondition?i(e.typeCondition):null},f=function(t){return t.kind===e.Kind.FIELD},c=function(t){return t.kind===e.Kind.INLINE_FRAGMENT},l=function(t,r){var n={},o=0;if(t.arguments&&t.arguments.length)for(var a=0,u=t.arguments.length;a<u;a++){var s=t.arguments[a],f=e.valueFromASTUntyped(s.value,r);null!=f&&(n[i(s)]=f,o++)}return 0<o?n:null},d=function(e,t){if(t&&e.variableDefinitions){for(var r={},n=0,o=e.variableDefinitions.length;n<o;n++){var a=i(e.variableDefinitions[n].variable);r[a]=t[a]}return r}},p=function(t,r){var n={};if(!r)return n;if(t.variableDefinitions)for(var o=0,a=t.variableDefinitions.length;o<a;o++){var u=t.variableDefinitions[o],s=i(u.variable);n[s]=void 0===r[s]&&u.defaultValue?e.valueFromASTUntyped(u.defaultValue,r):r[s]}for(var f in r)f in n||(n[f]=r[f]);return n};function y(e,t,r){if(!e)throw(e=Error((t||"Minfied Error #"+r+"\n")+"\nhttps://bit.ly/2XbVrpR#"+r)).name="Graphcache Error",e}new Set;var v=function(t){for(var r=0;r<t.definitions.length;r++)if(t.definitions[r].kind===e.Kind.OPERATION_DEFINITION)return t.definitions[r];y(!1,"",1)},m=function(t){for(var r={},n=0;n<t.definitions.length;n++){var o=t.definitions[n];o.kind===e.Kind.FRAGMENT_DEFINITION&&(r[i(o)]=o)}return r},h=function(t,r){var n=t.directives;if(!n)return!0;for(var o=0,a=n.length;o<a;o++){var u=n[o];if(("include"===(t=i(u))||"skip"===t)&&u.arguments&&u.arguments[0]&&"if"===i(u.arguments[0]))return r=e.valueFromASTUntyped(u.arguments[0].value,r),"include"===t?!!r:!r}return!0};function k(e){for(var t={},r=0;r<e.length;r++)t[e[r].name]=e[r];return t}var g=/^__/,O=function(e,t,r){return!!g.test(r)||!!(e=_(e,t,r))&&"NON_NULL"!==e.type.kind},b=function(e,t,r){return!!(e=_(e,t,r))&&"LIST"===(e="NON_NULL"===e.type.kind?e.type.ofType:e.type).kind&&"NON_NULL"!==e.ofType.kind},q=function(e,t,r){return!!r&&(!(t=s(t))||r===t||(e.types[t]&&"OBJECT"===e.types[t].kind?t===r:(function(e,t){y(e.types[t]&&("INTERFACE"===e.types[t].kind||"UNION"===e.types[t].kind),"",5)}(e,t),w(e,r),e.isSubType(t,r))))},_=function(e,t,r){return w(e,t),e.types[t].fields[r]};function w(e,t){y(e.types[t]&&"OBJECT"===e.types[t].kind,"",3)}var N=function(e,r){return r?e+"("+t.stringifyVariables(r)+")":e},x=function(e,t){return e+"."+t},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){var t=e.indexOf(".");return{entityKey:e.slice(0,t).replace(/%2e/g,"."),fieldKey:e=e.slice(t+1)}},S=function(){return Object.create(null)},T=null,F=null,A=null,L=null,D=!1,M=function(){return{optimistic:S(),base:new Map}},I=function(e,t,r,n){T=e,F=t,A=S(),D=!!n,r?n||0<t.optimisticOrder.length?(n||t.commutativeKeys.has(r)?n&&t.commutativeKeys.delete(r):ee(t,r),L=r,te(t,r)):(L=null,ne(t,r)):L=null},C=function(){var e=F,t=L;if(D=!1,L=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]);)ae(e.optimisticOrder[t]);A=F=T=null,e.defer||(e.defer=!0,Promise.resolve().then((function(){I("read",e,null),z(),se(),C(),e.defer=!1})))},P=function(e,t,r){I("read",e,t,r),C()},R=function(){return y(null!==A,"",2),A},U=function(e,t,r,n){var i=(e=L?e.optimistic[L]:e.base).get(t);void 0===i&&e.set(t,i=S()),void 0!==n||L?i[r]=n:delete i[r]},J=function(e,t,r){for(var n,i=0,o=F.optimisticOrder.length;i<o;i++){var a=F.optimisticOrder[i],u=e.optimistic[a];if(u&&(!D||"write"===T||F.commutativeKeys.has(a))&&void 0!==(n=u.get(t))&&r in n)return n[r]}return void 0!==(n=e.base.get(t))?n[r]:void 0},j=function(e,t,r,n){var i=void 0!==t[r]?t[r]:0;t=t[r]=i+n|0,void 0!==e&&(0>=t?e.add(r):0>=i&&0<t&&e.delete(r))},B=function(e,t,r,n){if("string"==typeof r)j(e,t,r,n);else if(Array.isArray(r))for(var i=0,o=r.length;i<o;i++){var a=r[i];a&&j(e,t,a,n)}},V=function(e,t,r){if(void 0!==r)for(var n in r)t.has(n)||(e.push(E(n)),t.add(n))},Q=function(e,t,r,n){V(e,t,n.base.get(r));for(var i=0,o=F.optimisticOrder.length;i<o;i++){var a=n.optimistic[F.optimisticOrder[i]];void 0!==a&&V(e,t,a.get(r))}};function G(e,t,r){if(0<(F.refCount[e]||0))r.delete(e);else{for(var n in F.refLock){if(0<((t=F.refLock[n])[e]||0))return;delete t[e]}if(delete F.refCount[e],r.delete(e),F.records.base.delete(e),n=F.links.base.get(e))for(var i in F.links.base.delete(e),n)B(r,F.refCount,n[i],-1)}}var z=function(){F.gc.forEach(G)},X=function(e,t){"__typename"!==t&&(e!==F.queryRootKey?A[e]=!0:void 0!==t&&(A[x(e,t)]=!0))},H=function(e,t){!D&&F.storage&&F.persist.add(function(e,t){return e.replace(/\./g,"%2e")+"."+t}(e,t))},W=function(e,t){return X(e,t),J(F.records,e,t)},Y=function(e,t){return X(e,t),J(F.links,e,t)},Z=function(e,t,r){X(e,t),H(e,t),U(F.records,e,t,r)},$=function(e,t,r){var n=F;if(L)var i=n.refLock[L]||(n.refLock[L]=S()),o=n.links.optimistic[L];else{i=n.refCount,o=n.links.base;var a=n.gc}o=(o=o&&o.get(e))&&o[t],X(e,t),H(e,t),U(n.links,e,t,r),B(a,i,o,-1),B(a,i,r,1)},ee=function(e,t){var r=e.optimisticOrder.indexOf(t);-1===r?e.optimisticOrder.unshift(t):e.commutativeKeys.has(t)||(re(e,t),e.optimisticOrder.splice(r,1),e.optimisticOrder.unshift(t)),e.commutativeKeys.add(t)},te=function(e,t){-1===e.optimisticOrder.indexOf(t)&&e.optimisticOrder.unshift(t),e.refLock[t]||(e.refLock[t]=S(),e.links.optimistic[t]=new Map,e.records.optimistic[t]=new Map)},re=function(e,t){e.refLock[t]&&(delete e.refLock[t],delete e.records.optimistic[t],delete e.links.optimistic[t])},ne=function(e,t){var r=e.optimisticOrder.indexOf(t);-1<r&&(e.optimisticOrder.splice(r,1),e.commutativeKeys.delete(t)),re(e,t)};function ie(e,t){for(var r in e)$(t,r,e[r])}function oe(e,t){for(var r in e)Z(t,r,e[r])}var ae=function(e){var t=A;A=S();var r=F.links.optimistic[e];r&&r.forEach(ie),(r=F.records.optimistic[e])&&r.forEach(oe),A=t,ne(F,e)},ue=function(e){var t=F.links,r=F.records,n=[],i=new Set;return X(e),Q(n,i,e,t),Q(n,i,e,r),n},se=function(){if(F.storage){D=!0,T="read";var e=S();F.persist.forEach((function(r){var n,i=K(r),o=i.entityKey;e[r]=void 0!==(n=Y(o,i=i.fieldKey))?":"+t.stringifyVariables(n):void 0!==(n=W(o,i))?t.stringifyVariables(n):void 0})),D=!1,F.storage.writeData(e),F.persist.clear()}},fe={current:null},ce=function(e,t,r,n,i,o){return{store:e,variables:t,fragments:r,parent:{__typename:n},parentTypeName:n,parentKey:i,parentFieldKey:"",fieldName:"",partial:!1,optimistic:!!o}},le=function(e,t,r,n,i,o){fe.current=e,e.parent=t,e.parentTypeName=r,e.parentKey=n,e.parentFieldKey=i,e.fieldName=o},de=function(e,t,r,n){if(!t)return!1;var o=s(e);return!o||t===o||!u(e).some((function(e){return!!f(e)&&(e=N(i(e),l(e,n)),!function(e,t){return void 0!==W(e,t)||void 0!==Y(e,t)}(r,e))}))},pe=function(e,t,r,n){var o,a=0;return function(){if(void 0!==o){var s=o();if(void 0!==s)return s;o=void 0}for(;a<r.length;)if(s=r[a++],h(s,n.variables)){if(f(s))return s;if(void 0!==(s=c(s)?s:n.fragments[i(s)])&&(n.store.schema?q(n.store.schema,s,e):de(s,e,t,n.variables)))return(o=pe(e,t,u(s),n))()}}},ye=function(e){return void 0===e?null:e},ve=function(e,t,r,n){return I("write",e.data,n||null),e=me(e,t,r),C(),e},me=function(e,t,r){var n=v(t.query),i={data:r,dependencies:R()},o=e.rootFields[n.operation];return e=ce(e,p(n,t.variables),m(t.query),o,o),he(e,o,u(n),r),i},he=function(e,t,r,n){var o=t===e.store.rootFields.query,s=!o&&!!e.store.rootNames[t],f=s||o?t:n.__typename;if(f){s||o||!t||Z(t,"__typename",f),r=pe(f,t||f,r,e);for(var c;c=r();){o=i(c);var d=l(c,e.variables),p=N(o,d),y=a(c),v=n[y];if("__typename"!==o){if(e.optimistic&&s){if(!(v=e.store.optimisticMutations[o]))continue;le(e,n,f,f,p,o),v=n[y]=ye(v(d||{},e.store,e))}c.selectionSet?t&&!s?(y=x(t,p),c=ke(e,u(c),ye(v),y),$(t||f,p,c)):ke(e,u(c),ye(v)):t&&!s&&Z(t||f,p,v),s&&(le(e,n,f,f,x(f,p),o),p=e.store.updates[f][o])&&(n[o]=v,p(n,d||{},e.store,e))}}}},ke=function(e,t,r,n){if(Array.isArray(r)){for(var i=Array(r.length),o=0,a=r.length;o<a;o++){var u=r[o],s=n?x(n,""+o):void 0;u=ke(e,t,u,s),i[o]=u}return i}return null===r?null:(n=e.store.keyOfEntity(r)||n,he(e,n,t,r),n||null)},ge=function(e){var t,r;this.keyOfField=N,e||(e={}),this.resolvers=e.resolvers||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{};var n="Query",i="Mutation",o="Subscription";if(e.schema){var a=this.schema=function(e){function t(e){return{name:e.name,type:e.type,args:n(e.args)}}e=e.__schema;for(var r={},n=k,i=function(e){switch(e.kind){case"OBJECT":case"INTERFACE":return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map(t))};case"UNION":return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},o=0;o<e.types.length;o++){var a=e.types[o];if(a&&a.name){var u=i(a);u&&(r[a.name]=u)}}return{query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:r,isSubType:function(e,t){var n=r[e],i=r[t];return!!(n&&i&&("UNION"===n.kind?n.types[t]:"OBJECT"!==n.kind&&"OBJECT"===i.kind?i.interfaces[e]:e===t))}}}(e.schema);n=a.query||n,i=a.mutation||i,o=a.subscription||o}this.updates=((t={})[i]=e.updates&&e.updates.Mutation||{},t[o]=e.updates&&e.updates.Subscription||{},t),this.rootFields={query:n,mutation:i,subscription:o},this.rootNames=((r={})[n]="query",r[i]="mutation",r[o]="subscription",r),this.data=function(e){return{defer:!1,gc:new Set,persist:new Set,queryRootKey:e,refCount:S(),refLock:S(),links:M(),records:M(),commutativeKeys:new Set,optimisticOrder:[],storage:null}}(n)};ge.prototype.keyOfEntity=function(e){if(null==e||"string"==typeof e)return e||null;var t,r=e.__typename,n=e.id,i=e._id;return r?this.rootNames[r]?r:fe.current&&e===fe.current.parent?fe.current.parentKey:(this.keys[r]?t=this.keys[r](e):null!=n?t=""+n:null!=i&&(t=""+i),t?r+":"+t:null):null},ge.prototype.resolveFieldByKey=function(e,t){if(!(e=this.keyOfEntity(e)))return null;var r=W(e,t);return void 0!==r?r:(t=Y(e,t))?t:null},ge.prototype.resolve=function(e,t,r){return this.resolveFieldByKey(e,N(t,r))},ge.prototype.invalidate=function(e,t,r){y(e=this.keyOfEntity(e),"",19),function(e,t,r){t=t?[{fieldKey:N(t,r)}]:ue(e),r=0;for(var n=t.length;r<n;r++){var i=t[r].fieldKey;void 0!==Y(e,i)?$(e,i,void 0):Z(e,i,void 0)}}(e,t,r)},ge.prototype.inspectFields=function(e){return(e=this.keyOfEntity(e))?ue(e):[]},ge.prototype.updateQuery=function(e,r){(e=t.createRequest(e.query,e.variables)).query=t.formatDocument(e.query),null!==(r=r(this.readQuery(e)))&&me(this,e,r)},ge.prototype.readQuery=function(e){return(e=t.createRequest(e.query,e.variables)).query=t.formatDocument(e.query),be(this,e).data},ge.prototype.readFragment=function(e,r,n){return we(this,t.formatDocument(e),r,n)},ge.prototype.writeFragment=function(e,n,i){!function(e,t,n,i){t=m(t);var a=Object.keys(t);if(a=t[a[0]]){var s=o(a);n=r._extends({},{__typename:s},n);var f=e.keyOfEntity(n);f&&(e=ce(e,i||{},t,s,f),he(e,f,u(a),n))}}(this,t.formatDocument(e),n,i)};var Oe=function(e,t,r){return I("read",e.data,null),e=be(e,t,r),C(),e},be=function(e,t,r){var n=v(t.query),i=e.rootFields[n.operation],o=u(n);return r=i!==(e=ce(e,p(n,t.variables),m(t.query),i,i)).store.rootFields.query?qe(e,i,o,r||{}):Ne(e,i,o,{}),{dependencies:R(),partial:e.partial||!r,data:r||null}},qe=function(e,t,r,n){if("string"!=typeof n.__typename)return n;t=pe(t,t,r,e),(r={}).__typename=n.__typename;for(var i;i=t();){var o=a(i),s=n[o];i.selectionSet&&null!==s?(s=ye(s),r[o]=_e(e,u(i),s)):r[o]=s}return r},_e=function(e,t,r){if(Array.isArray(r)){for(var n=Array(r.length),i=0,o=r.length;i<o;i++)n[i]=_e(e,t,r[i]);return n}return null===r?null:null!==(n=e.store.keyOfEntity(r))?void 0===(e=Ne(e,n,t,{}))?null:e:qe(e,r.__typename,t,r)},we=function(e,t,r,n){t=m(t);var i=Object.keys(t);if(!(i=t[i[0]]))return null;var a=o(i);return"string"==typeof r||r.__typename||(r.__typename=a),(r=e.keyOfEntity(r))?(e=ce(e,n||{},t,a,r),Ne(e,r,u(i),{})||null):null},Ne=function(e,t,r,n,o){var s=e.store,f=t===s.rootFields.query,c=o&&s.keyOfEntity(o)||t;if("string"==typeof(t=f?t:W(c,"__typename")||o&&o.__typename)&&(!o||t===o.__typename)){r=pe(t,c,r,e);for(var d,p=!1,v=!1;void 0!==(d=r());){var m=i(d),h=l(d,e.variables),k=a(d),g=N(m,h),b=x(c,g),q=W(c,g),_=o?o[m]:void 0,w=s.resolvers[t],E=void 0;if("__typename"===m)n[k]=t;else{if(void 0!==_&&void 0===d.selectionSet)E=_;else if("read"===(y(null!==T,"",2),T)&&w&&"function"==typeof w[m]){if(le(e,n,t,c,b,m),void 0!==q&&(n[k]=q),E=w[m](n,h||{},s,e),d.selectionSet&&(E=xe(e,t,m,b,u(d),n[k],E)),s.schema&&null===E&&!O(s.schema,t,m))return}else d.selectionSet?void 0!==_?E=xe(e,t,m,b,u(d),n[k],_):void 0!==(h=Y(c,g))?E=Ee(e,h,t,m,u(d),n[k]):"object"==typeof q&&null!==q&&(E=q):E=q;if(void 0===E&&s.schema&&O(s.schema,t,m))v=!0,n[k]=null;else{if(void 0===E)return;p=!0,n[k]=E}}}return v&&(e.partial=!0),f&&v&&!p?void 0:n}},xe=function(e,t,r,n,i,o,a){if(Array.isArray(a)){var u=e.store;u=!u.schema||b(u.schema,t,r);for(var s=Array(a.length),f=0,c=a.length;f<c;f++){var l=xe(e,t,r,x(n,""+f),i,null!=o?o[f]:void 0,a[f]);if(void 0===l&&!u)return;s[f]=void 0!==l?l:null}return s}return null==a?a:null===o?null:Ke(a)?(t=o||{},"string"==typeof a?Ne(e,a,i,t):Ne(e,n,i,t,a)):void 0},Ee=function(e,t,r,n,i,o){if(Array.isArray(t)){var a=e.store;a=a.schema&&b(a.schema,r,n);for(var u=Array(t.length),s=0,f=t.length;s<f;s++){var c=Ee(e,t[s],r,n,i,null!=o?o[s]:void 0);if(void 0===c&&!a)return;u[s]=void 0!==c?c:null}return u}return null===t||null===o?null:Ne(e,t,i,o||{})},Ke=function(e){return"string"==typeof e||"object"==typeof e&&"string"==typeof e.__typename},Se=function(e,n){return t.makeOperation(e.kind,e,r._extends({},e.context,{meta:r._extends({},e.context.meta,{cacheOutcome:n})}))},Te=function(e,n){return t.makeOperation(e.kind,e,r._extends({},e.context,{requestPolicy:n}))};function Fe(e){return n.fromArray(e[0])}function Ae(e,t){return e.push(t),e}function Le(e){return"query"===e.kind&&"network-only"!==e.context.requestPolicy}function De(e){return"query"!==e.kind||"network-only"===e.context.requestPolicy}function Me(e){return"miss"!==e.outcome||"cache-only"===e.operation.context.requestPolicy}var Ie=function(e){return function(r){function i(e){return Se(e.operation,"miss")}function o(e){return"miss"===e.outcome&&"cache-only"!==e.operation.context.requestPolicy&&!E(e.dependencies)}function a(e){var t=e.operation,r=e.outcome,n=e.dependencies;return e={operation:Se(t,r),data:e.data,error:e.error,extensions:e.extensions},("cache-and-network"===t.context.requestPolicy||"cache-first"===t.context.requestPolicy&&"partial"===r)&&(e.stale=!0,E(n)?"cache-and-network"===t.context.requestPolicy&&N.add(t.key):g.reexecuteOperation(Te(t,"network-only"))),e}function s(e){var t=new Set,r=M(e,t);return F(e.operation,t),r}function f(e){return!b.has(e.operation.key)}function c(e){if(q.push(e)<b.size)return n.empty;for(var t=0;t<q.length;t++)ee(O.data,q[t].operation.key);for(var r in w)delete w[r];t=[],r=new Set;for(var i;i=q.shift();)t.push(M(i,r));return F(e.operation,r),n.fromArray(t)}function l(e){return b.has(e.operation.key)}var h,k=r.forward,g=r.client,O=new ge(e);e&&e.storage&&(h=e.storage.readData().then((function(t){!function(e,t,r){for(var n in I("write",e,null),r){var i=r[n];if(void 0!==i){var o=K(n),a=o.entityKey;o=o.fieldKey,":"===i[0]?$(a,o,JSON.parse(i.slice(1))):Z(a,o,JSON.parse(i))}}C(),e.storage=t}(O.data,e.storage,t)})));var b=new Map,q=[],_=new Map,w=S(),N=new Set,x=S(),E=function(e){for(var t in e)if(w[t])return!0;return!1},T=function(e,t){if(t)for(var r in t)if(t=x[r]){x[r]=[];for(var n=0,i=t.length;n<i;n++)e.add(t[n])}},F=function(e,t){t.forEach((function(t){if(t!==e.key){var r=_.get(t);if(r){_.delete(t);var n="cache-first";N.has(t)&&(N.delete(t),n="cache-and-network"),g.reexecuteOperation(Te(r,n))}}}))},A=function(e){if("query"===e.kind)ee(O.data,e.key);else if("teardown"===e.kind)_.delete(e.key),P(O.data,e.key);else if("mutation"===e.kind&&"network-only"!==e.context.requestPolicy){var r=function(e,t,r){I("write",e.data,r,!0),r=v(t.query);var n={data:{},dependencies:R()},i=e.rootFields[r.operation];return y(i===e.rootFields.mutation,"",10),e=ce(e,p(r,t.variables),m(t.query),i,i,!0),he(e,i,u(r),n.data),C(),n}(O,e,e.key).dependencies;if(!function(e){for(var t in e)return!1;return!0}(r)){for(var n in r)w[n]=!0;b.set(e.key,r),n=new Set,T(n,r),F(e,n)}}return t.makeOperation(e.kind,{key:e.key,query:t.formatDocument(e.query),variables:e.variables?d(v(e.query),e.variables):e.variables},e.context)},L=function(e,t){for(var r in t)(x[r]||(x[r]=[])).push(e.key),_.set(e.key,e)},D=function(e){var t=Oe(O,e),r=t.data?t.partial?"partial":"hit":"miss";return L(e,t.dependencies),{outcome:r,operation:e,data:t.data,dependencies:t.dependencies}},M=function(e,t){var r=e.operation,n=e.error,i=e.extensions,o=r.key;if("mutation"===r.kind){var a=b.get(o);T(t,a),b.delete(o)}else ee(O.data,r.key);if(e.data){if(o=ve(O,r,e.data,o).dependencies,T(t,o),o=Oe(O,r,e.data),e.data=o.data,"query"===r.kind){var u=o.dependencies;T(t,u)}}else P(O.data,r.key);return u&&L(e.operation,u),{data:e.data,error:n,extensions:i,operation:r}};return function(e){e=n.share(e);var t=h?n.mergeMap(Fe)(n.take(1)(n.combine(n.scan(Ae,[])(e),n.fromPromise(h)))):n.empty;t=n.share(n.concat([t,e])),e=n.share(n.map(D)(n.filter(Le)(t))),t=n.filter(De)(t);var r=n.map(i)(n.filter(o)(e));return e=n.map(a)(n.filter(Me)(e)),r=n.share(k(n.map(A)(n.merge([t,r])))),t=n.map(s)(n.filter(f)(r)),r=n.mergeMap(c)(n.filter(l)(r)),n.merge([t,r,e])}}},Ce=function(e){return e&&e.networkError&&!e.response&&("undefined"!=typeof navigator&&!1===navigator.onLine||/request failed|failed to fetch|network\s?error/i.test(e.networkError.message))};exports.Store=ge,exports.cacheExchange=Ie,exports.offlineExchange=function(r){return function(o){function a(e){return"mutation"!==e.operation.kind||!Ce(e.error)||!function(e,t){var r,n=t.variables||S(),o=m(t.query);for(t=[].concat(u(v(t.query)));r=t.pop();)if(h(r,n))if(f(r)){if(e[i(r)])return!0}else(r=c(r)?r:o[i(r)])&&t.push.apply(t,u(r));return!1}(O,e.operation)||(b.push(e.operation),q(),!1)}function s(e){return"query"!==e.operation.kind||!Ce(e.error)||(g(Te(e.operation,"cache-only")),b.push(e.operation),!1)}var l=r.storage;if(l&&l.onOnline&&l.readMetadata&&l.writeMetadata){var d=o.forward,p=o.client;o=o.dispatchDebug;var y=n.makeSubject(),k=y.source,g=y.next,O=r.optimistic||{},b=[],q=function(){for(var t=[],r=0;r<b.length;r++){var n=b[r];"mutation"===n.kind&&t.push({query:e.print(n.query),variables:n.variables})}l.writeMetadata(t)},_=!1,w=function(){if(!_){_=!0;for(var e=0;e<b.length;e++){var r=b[e];"mutation"===r.kind&&g(t.makeOperation("teardown",r))}for(e=0;e<b.length;e++)p.reexecuteOperation(b[e]);b.length=0,_=!1,q()}};l.onOnline(w),l.readMetadata().then((function(e){if(e){for(var r=0;r<e.length;r++)b.push(p.createRequestOperation("mutation",t.createRequest(e[r].query,e[r].variables)));w()}}));var N=Ie(r)({client:p,dispatchDebug:o,forward:function(e){return n.filter(a)(d(e))}});return function(e){return e=n.share(e),e=n.merge([k,e]),n.filter(s)(N(e))}}return Ie(r)(o)}},exports.query=Oe,exports.write=ve; | ||
//# sourceMappingURL=urql-exchange-graphcache.min.js.map |
{ | ||
"name": "@urql/exchange-graphcache", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "A normalized and configurable cache exchange for urql", | ||
@@ -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
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
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
696468
3597