houdini 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +88 -8
- package/build/cmd-esm/index.js +88 -8
- package/build/codegen-cjs/index.js +86 -6
- package/build/codegen-esm/index.js +86 -6
- package/build/lib-cjs/index.js +48 -8
- package/build/lib-esm/index.js +48 -8
- package/build/runtime/cache/cache.d.ts +1 -1
- package/build/runtime/cache/lists.d.ts +3 -1
- package/build/runtime-cjs/cache/cache.d.ts +1 -1
- package/build/runtime-cjs/cache/cache.js +31 -5
- package/build/runtime-cjs/cache/lists.d.ts +3 -1
- package/build/runtime-cjs/cache/lists.js +15 -1
- package/build/runtime-cjs/client/plugins/fetch.js +1 -1
- package/build/runtime-cjs/router/match.js +1 -1
- package/build/runtime-esm/cache/cache.d.ts +1 -1
- package/build/runtime-esm/cache/cache.js +31 -5
- package/build/runtime-esm/cache/lists.d.ts +3 -1
- package/build/runtime-esm/cache/lists.js +15 -1
- package/build/runtime-esm/client/plugins/fetch.js +1 -1
- package/build/runtime-esm/router/match.js +1 -1
- package/build/test-cjs/index.js +86 -6
- package/build/test-esm/index.js +86 -6
- package/build/vite/ast.d.ts +8 -2
- package/build/vite-cjs/index.js +331 -246
- package/build/vite-esm/index.js +331 -246
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -65336,7 +65336,18 @@ var ListManager = class {
|
|
|
65336
65336
|
}
|
|
65337
65337
|
lists = /* @__PURE__ */ new Map();
|
|
65338
65338
|
listsByField = /* @__PURE__ */ new Map();
|
|
65339
|
-
get(listName, id, allLists) {
|
|
65339
|
+
get(listName, id, allLists, skipMatches) {
|
|
65340
|
+
const lists = this.getLists(listName, id, allLists);
|
|
65341
|
+
if (!lists) {
|
|
65342
|
+
return null;
|
|
65343
|
+
}
|
|
65344
|
+
if (skipMatches) {
|
|
65345
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
65346
|
+
} else {
|
|
65347
|
+
return lists;
|
|
65348
|
+
}
|
|
65349
|
+
}
|
|
65350
|
+
getLists(listName, id, allLists) {
|
|
65340
65351
|
const matches = this.lists.get(listName);
|
|
65341
65352
|
if (!matches || matches.size === 0) {
|
|
65342
65353
|
return null;
|
|
@@ -65458,6 +65469,9 @@ var List = class {
|
|
|
65458
65469
|
this.manager = manager;
|
|
65459
65470
|
this.abstract = abstract;
|
|
65460
65471
|
}
|
|
65472
|
+
get fieldRef() {
|
|
65473
|
+
return `${this.recordID}.${this.key}`;
|
|
65474
|
+
}
|
|
65461
65475
|
when(when) {
|
|
65462
65476
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
65463
65477
|
}
|
|
@@ -66610,8 +66624,8 @@ var Cache = class {
|
|
|
66610
66624
|
variables
|
|
66611
66625
|
);
|
|
66612
66626
|
}
|
|
66613
|
-
list(name, parentID, allLists) {
|
|
66614
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
66627
|
+
list(name, parentID, allLists, skipMatches) {
|
|
66628
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
66615
66629
|
if (!handler) {
|
|
66616
66630
|
throw new Error(
|
|
66617
66631
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -67026,6 +67040,7 @@ var CacheInternal = class {
|
|
|
67026
67040
|
});
|
|
67027
67041
|
}
|
|
67028
67042
|
}
|
|
67043
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
67029
67044
|
for (const operation of operations || []) {
|
|
67030
67045
|
let parentID;
|
|
67031
67046
|
if (operation.parentID) {
|
|
@@ -67045,7 +67060,12 @@ var CacheInternal = class {
|
|
|
67045
67060
|
const targets = Array.isArray(value) ? value : [value];
|
|
67046
67061
|
for (const target of targets) {
|
|
67047
67062
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
67048
|
-
this.cache.list(
|
|
67063
|
+
this.cache.list(
|
|
67064
|
+
operation.list,
|
|
67065
|
+
parentID,
|
|
67066
|
+
operation.target === "all",
|
|
67067
|
+
processedOperations
|
|
67068
|
+
).when(operation.when).addToList(
|
|
67049
67069
|
fieldSelection,
|
|
67050
67070
|
target,
|
|
67051
67071
|
variables,
|
|
@@ -67053,7 +67073,12 @@ var CacheInternal = class {
|
|
|
67053
67073
|
layer
|
|
67054
67074
|
);
|
|
67055
67075
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
67056
|
-
this.cache.list(
|
|
67076
|
+
this.cache.list(
|
|
67077
|
+
operation.list,
|
|
67078
|
+
parentID,
|
|
67079
|
+
operation.target === "all",
|
|
67080
|
+
processedOperations
|
|
67081
|
+
).when(operation.when).toggleElement({
|
|
67057
67082
|
selection: fieldSelection,
|
|
67058
67083
|
data: target,
|
|
67059
67084
|
variables,
|
|
@@ -67061,7 +67086,12 @@ var CacheInternal = class {
|
|
|
67061
67086
|
layer
|
|
67062
67087
|
});
|
|
67063
67088
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
67064
|
-
this.cache.list(
|
|
67089
|
+
this.cache.list(
|
|
67090
|
+
operation.list,
|
|
67091
|
+
parentID,
|
|
67092
|
+
operation.target === "all",
|
|
67093
|
+
processedOperations
|
|
67094
|
+
).when(operation.when).remove(target, variables, layer);
|
|
67065
67095
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
67066
67096
|
const targetID = this.id(operation.type, target);
|
|
67067
67097
|
if (!targetID) {
|
|
@@ -67073,6 +67103,16 @@ var CacheInternal = class {
|
|
|
67073
67103
|
this.cache.delete(targetID, layer);
|
|
67074
67104
|
}
|
|
67075
67105
|
}
|
|
67106
|
+
if (operation.list) {
|
|
67107
|
+
const matchingLists = this.cache.list(
|
|
67108
|
+
operation.list,
|
|
67109
|
+
parentID,
|
|
67110
|
+
operation.target === "all"
|
|
67111
|
+
);
|
|
67112
|
+
for (const list of matchingLists.lists) {
|
|
67113
|
+
processedOperations.add(list.fieldRef);
|
|
67114
|
+
}
|
|
67115
|
+
}
|
|
67076
67116
|
}
|
|
67077
67117
|
}
|
|
67078
67118
|
return toNotify;
|
|
@@ -71056,6 +71096,46 @@ function objectNode([type, defaultValue]) {
|
|
|
71056
71096
|
return node;
|
|
71057
71097
|
}
|
|
71058
71098
|
var pageInfoSelection = [
|
|
71099
|
+
{
|
|
71100
|
+
kind: graphql13.Kind.FIELD,
|
|
71101
|
+
name: {
|
|
71102
|
+
kind: graphql13.Kind.NAME,
|
|
71103
|
+
value: "pageInfo"
|
|
71104
|
+
},
|
|
71105
|
+
selectionSet: {
|
|
71106
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
71107
|
+
selections: [
|
|
71108
|
+
{
|
|
71109
|
+
kind: graphql13.Kind.FIELD,
|
|
71110
|
+
name: {
|
|
71111
|
+
kind: graphql13.Kind.NAME,
|
|
71112
|
+
value: "hasPreviousPage"
|
|
71113
|
+
}
|
|
71114
|
+
},
|
|
71115
|
+
{
|
|
71116
|
+
kind: graphql13.Kind.FIELD,
|
|
71117
|
+
name: {
|
|
71118
|
+
kind: graphql13.Kind.NAME,
|
|
71119
|
+
value: "hasNextPage"
|
|
71120
|
+
}
|
|
71121
|
+
},
|
|
71122
|
+
{
|
|
71123
|
+
kind: graphql13.Kind.FIELD,
|
|
71124
|
+
name: {
|
|
71125
|
+
kind: graphql13.Kind.NAME,
|
|
71126
|
+
value: "startCursor"
|
|
71127
|
+
}
|
|
71128
|
+
},
|
|
71129
|
+
{
|
|
71130
|
+
kind: graphql13.Kind.FIELD,
|
|
71131
|
+
name: {
|
|
71132
|
+
kind: graphql13.Kind.NAME,
|
|
71133
|
+
value: "endCursor"
|
|
71134
|
+
}
|
|
71135
|
+
}
|
|
71136
|
+
]
|
|
71137
|
+
}
|
|
71138
|
+
},
|
|
71059
71139
|
{
|
|
71060
71140
|
kind: graphql13.Kind.FIELD,
|
|
71061
71141
|
name: {
|
|
@@ -78483,12 +78563,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78483
78563
|
}
|
|
78484
78564
|
packageJSON2.devDependencies = {
|
|
78485
78565
|
...packageJSON2.devDependencies,
|
|
78486
|
-
houdini: "^1.4.
|
|
78566
|
+
houdini: "^1.4.1"
|
|
78487
78567
|
};
|
|
78488
78568
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78489
78569
|
packageJSON2.devDependencies = {
|
|
78490
78570
|
...packageJSON2.devDependencies,
|
|
78491
|
-
"houdini-svelte": "^2.1.
|
|
78571
|
+
"houdini-svelte": "^2.1.1"
|
|
78492
78572
|
};
|
|
78493
78573
|
} else {
|
|
78494
78574
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -65342,7 +65342,18 @@ var ListManager = class {
|
|
|
65342
65342
|
}
|
|
65343
65343
|
lists = /* @__PURE__ */ new Map();
|
|
65344
65344
|
listsByField = /* @__PURE__ */ new Map();
|
|
65345
|
-
get(listName, id, allLists) {
|
|
65345
|
+
get(listName, id, allLists, skipMatches) {
|
|
65346
|
+
const lists = this.getLists(listName, id, allLists);
|
|
65347
|
+
if (!lists) {
|
|
65348
|
+
return null;
|
|
65349
|
+
}
|
|
65350
|
+
if (skipMatches) {
|
|
65351
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
65352
|
+
} else {
|
|
65353
|
+
return lists;
|
|
65354
|
+
}
|
|
65355
|
+
}
|
|
65356
|
+
getLists(listName, id, allLists) {
|
|
65346
65357
|
const matches = this.lists.get(listName);
|
|
65347
65358
|
if (!matches || matches.size === 0) {
|
|
65348
65359
|
return null;
|
|
@@ -65464,6 +65475,9 @@ var List = class {
|
|
|
65464
65475
|
this.manager = manager;
|
|
65465
65476
|
this.abstract = abstract;
|
|
65466
65477
|
}
|
|
65478
|
+
get fieldRef() {
|
|
65479
|
+
return `${this.recordID}.${this.key}`;
|
|
65480
|
+
}
|
|
65467
65481
|
when(when) {
|
|
65468
65482
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
65469
65483
|
}
|
|
@@ -66616,8 +66630,8 @@ var Cache = class {
|
|
|
66616
66630
|
variables
|
|
66617
66631
|
);
|
|
66618
66632
|
}
|
|
66619
|
-
list(name, parentID, allLists) {
|
|
66620
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
66633
|
+
list(name, parentID, allLists, skipMatches) {
|
|
66634
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
66621
66635
|
if (!handler) {
|
|
66622
66636
|
throw new Error(
|
|
66623
66637
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -67032,6 +67046,7 @@ var CacheInternal = class {
|
|
|
67032
67046
|
});
|
|
67033
67047
|
}
|
|
67034
67048
|
}
|
|
67049
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
67035
67050
|
for (const operation of operations || []) {
|
|
67036
67051
|
let parentID;
|
|
67037
67052
|
if (operation.parentID) {
|
|
@@ -67051,7 +67066,12 @@ var CacheInternal = class {
|
|
|
67051
67066
|
const targets = Array.isArray(value) ? value : [value];
|
|
67052
67067
|
for (const target of targets) {
|
|
67053
67068
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
67054
|
-
this.cache.list(
|
|
67069
|
+
this.cache.list(
|
|
67070
|
+
operation.list,
|
|
67071
|
+
parentID,
|
|
67072
|
+
operation.target === "all",
|
|
67073
|
+
processedOperations
|
|
67074
|
+
).when(operation.when).addToList(
|
|
67055
67075
|
fieldSelection,
|
|
67056
67076
|
target,
|
|
67057
67077
|
variables,
|
|
@@ -67059,7 +67079,12 @@ var CacheInternal = class {
|
|
|
67059
67079
|
layer
|
|
67060
67080
|
);
|
|
67061
67081
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
67062
|
-
this.cache.list(
|
|
67082
|
+
this.cache.list(
|
|
67083
|
+
operation.list,
|
|
67084
|
+
parentID,
|
|
67085
|
+
operation.target === "all",
|
|
67086
|
+
processedOperations
|
|
67087
|
+
).when(operation.when).toggleElement({
|
|
67063
67088
|
selection: fieldSelection,
|
|
67064
67089
|
data: target,
|
|
67065
67090
|
variables,
|
|
@@ -67067,7 +67092,12 @@ var CacheInternal = class {
|
|
|
67067
67092
|
layer
|
|
67068
67093
|
});
|
|
67069
67094
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
67070
|
-
this.cache.list(
|
|
67095
|
+
this.cache.list(
|
|
67096
|
+
operation.list,
|
|
67097
|
+
parentID,
|
|
67098
|
+
operation.target === "all",
|
|
67099
|
+
processedOperations
|
|
67100
|
+
).when(operation.when).remove(target, variables, layer);
|
|
67071
67101
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
67072
67102
|
const targetID = this.id(operation.type, target);
|
|
67073
67103
|
if (!targetID) {
|
|
@@ -67079,6 +67109,16 @@ var CacheInternal = class {
|
|
|
67079
67109
|
this.cache.delete(targetID, layer);
|
|
67080
67110
|
}
|
|
67081
67111
|
}
|
|
67112
|
+
if (operation.list) {
|
|
67113
|
+
const matchingLists = this.cache.list(
|
|
67114
|
+
operation.list,
|
|
67115
|
+
parentID,
|
|
67116
|
+
operation.target === "all"
|
|
67117
|
+
);
|
|
67118
|
+
for (const list of matchingLists.lists) {
|
|
67119
|
+
processedOperations.add(list.fieldRef);
|
|
67120
|
+
}
|
|
67121
|
+
}
|
|
67082
67122
|
}
|
|
67083
67123
|
}
|
|
67084
67124
|
return toNotify;
|
|
@@ -71061,6 +71101,46 @@ function objectNode([type, defaultValue]) {
|
|
|
71061
71101
|
return node;
|
|
71062
71102
|
}
|
|
71063
71103
|
var pageInfoSelection = [
|
|
71104
|
+
{
|
|
71105
|
+
kind: graphql13.Kind.FIELD,
|
|
71106
|
+
name: {
|
|
71107
|
+
kind: graphql13.Kind.NAME,
|
|
71108
|
+
value: "pageInfo"
|
|
71109
|
+
},
|
|
71110
|
+
selectionSet: {
|
|
71111
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
71112
|
+
selections: [
|
|
71113
|
+
{
|
|
71114
|
+
kind: graphql13.Kind.FIELD,
|
|
71115
|
+
name: {
|
|
71116
|
+
kind: graphql13.Kind.NAME,
|
|
71117
|
+
value: "hasPreviousPage"
|
|
71118
|
+
}
|
|
71119
|
+
},
|
|
71120
|
+
{
|
|
71121
|
+
kind: graphql13.Kind.FIELD,
|
|
71122
|
+
name: {
|
|
71123
|
+
kind: graphql13.Kind.NAME,
|
|
71124
|
+
value: "hasNextPage"
|
|
71125
|
+
}
|
|
71126
|
+
},
|
|
71127
|
+
{
|
|
71128
|
+
kind: graphql13.Kind.FIELD,
|
|
71129
|
+
name: {
|
|
71130
|
+
kind: graphql13.Kind.NAME,
|
|
71131
|
+
value: "startCursor"
|
|
71132
|
+
}
|
|
71133
|
+
},
|
|
71134
|
+
{
|
|
71135
|
+
kind: graphql13.Kind.FIELD,
|
|
71136
|
+
name: {
|
|
71137
|
+
kind: graphql13.Kind.NAME,
|
|
71138
|
+
value: "endCursor"
|
|
71139
|
+
}
|
|
71140
|
+
}
|
|
71141
|
+
]
|
|
71142
|
+
}
|
|
71143
|
+
},
|
|
71064
71144
|
{
|
|
71065
71145
|
kind: graphql13.Kind.FIELD,
|
|
71066
71146
|
name: {
|
|
@@ -78488,12 +78568,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78488
78568
|
}
|
|
78489
78569
|
packageJSON2.devDependencies = {
|
|
78490
78570
|
...packageJSON2.devDependencies,
|
|
78491
|
-
houdini: "^1.4.
|
|
78571
|
+
houdini: "^1.4.1"
|
|
78492
78572
|
};
|
|
78493
78573
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78494
78574
|
packageJSON2.devDependencies = {
|
|
78495
78575
|
...packageJSON2.devDependencies,
|
|
78496
|
-
"houdini-svelte": "^2.1.
|
|
78576
|
+
"houdini-svelte": "^2.1.1"
|
|
78497
78577
|
};
|
|
78498
78578
|
} else {
|
|
78499
78579
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
|
@@ -54557,7 +54557,18 @@ var ListManager = class {
|
|
|
54557
54557
|
}
|
|
54558
54558
|
lists = /* @__PURE__ */ new Map();
|
|
54559
54559
|
listsByField = /* @__PURE__ */ new Map();
|
|
54560
|
-
get(listName, id, allLists) {
|
|
54560
|
+
get(listName, id, allLists, skipMatches) {
|
|
54561
|
+
const lists = this.getLists(listName, id, allLists);
|
|
54562
|
+
if (!lists) {
|
|
54563
|
+
return null;
|
|
54564
|
+
}
|
|
54565
|
+
if (skipMatches) {
|
|
54566
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
54567
|
+
} else {
|
|
54568
|
+
return lists;
|
|
54569
|
+
}
|
|
54570
|
+
}
|
|
54571
|
+
getLists(listName, id, allLists) {
|
|
54561
54572
|
const matches = this.lists.get(listName);
|
|
54562
54573
|
if (!matches || matches.size === 0) {
|
|
54563
54574
|
return null;
|
|
@@ -54679,6 +54690,9 @@ var List = class {
|
|
|
54679
54690
|
this.manager = manager;
|
|
54680
54691
|
this.abstract = abstract;
|
|
54681
54692
|
}
|
|
54693
|
+
get fieldRef() {
|
|
54694
|
+
return `${this.recordID}.${this.key}`;
|
|
54695
|
+
}
|
|
54682
54696
|
when(when) {
|
|
54683
54697
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
54684
54698
|
}
|
|
@@ -55831,8 +55845,8 @@ var Cache = class {
|
|
|
55831
55845
|
variables
|
|
55832
55846
|
);
|
|
55833
55847
|
}
|
|
55834
|
-
list(name, parentID, allLists) {
|
|
55835
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
55848
|
+
list(name, parentID, allLists, skipMatches) {
|
|
55849
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
55836
55850
|
if (!handler) {
|
|
55837
55851
|
throw new Error(
|
|
55838
55852
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -56247,6 +56261,7 @@ var CacheInternal = class {
|
|
|
56247
56261
|
});
|
|
56248
56262
|
}
|
|
56249
56263
|
}
|
|
56264
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
56250
56265
|
for (const operation of operations || []) {
|
|
56251
56266
|
let parentID;
|
|
56252
56267
|
if (operation.parentID) {
|
|
@@ -56266,7 +56281,12 @@ var CacheInternal = class {
|
|
|
56266
56281
|
const targets = Array.isArray(value) ? value : [value];
|
|
56267
56282
|
for (const target of targets) {
|
|
56268
56283
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
56269
|
-
this.cache.list(
|
|
56284
|
+
this.cache.list(
|
|
56285
|
+
operation.list,
|
|
56286
|
+
parentID,
|
|
56287
|
+
operation.target === "all",
|
|
56288
|
+
processedOperations
|
|
56289
|
+
).when(operation.when).addToList(
|
|
56270
56290
|
fieldSelection,
|
|
56271
56291
|
target,
|
|
56272
56292
|
variables,
|
|
@@ -56274,7 +56294,12 @@ var CacheInternal = class {
|
|
|
56274
56294
|
layer
|
|
56275
56295
|
);
|
|
56276
56296
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
56277
|
-
this.cache.list(
|
|
56297
|
+
this.cache.list(
|
|
56298
|
+
operation.list,
|
|
56299
|
+
parentID,
|
|
56300
|
+
operation.target === "all",
|
|
56301
|
+
processedOperations
|
|
56302
|
+
).when(operation.when).toggleElement({
|
|
56278
56303
|
selection: fieldSelection,
|
|
56279
56304
|
data: target,
|
|
56280
56305
|
variables,
|
|
@@ -56282,7 +56307,12 @@ var CacheInternal = class {
|
|
|
56282
56307
|
layer
|
|
56283
56308
|
});
|
|
56284
56309
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
56285
|
-
this.cache.list(
|
|
56310
|
+
this.cache.list(
|
|
56311
|
+
operation.list,
|
|
56312
|
+
parentID,
|
|
56313
|
+
operation.target === "all",
|
|
56314
|
+
processedOperations
|
|
56315
|
+
).when(operation.when).remove(target, variables, layer);
|
|
56286
56316
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
56287
56317
|
const targetID = this.id(operation.type, target);
|
|
56288
56318
|
if (!targetID) {
|
|
@@ -56294,6 +56324,16 @@ var CacheInternal = class {
|
|
|
56294
56324
|
this.cache.delete(targetID, layer);
|
|
56295
56325
|
}
|
|
56296
56326
|
}
|
|
56327
|
+
if (operation.list) {
|
|
56328
|
+
const matchingLists = this.cache.list(
|
|
56329
|
+
operation.list,
|
|
56330
|
+
parentID,
|
|
56331
|
+
operation.target === "all"
|
|
56332
|
+
);
|
|
56333
|
+
for (const list of matchingLists.lists) {
|
|
56334
|
+
processedOperations.add(list.fieldRef);
|
|
56335
|
+
}
|
|
56336
|
+
}
|
|
56297
56337
|
}
|
|
56298
56338
|
}
|
|
56299
56339
|
return toNotify;
|
|
@@ -59249,6 +59289,46 @@ function objectNode([type, defaultValue]) {
|
|
|
59249
59289
|
return node;
|
|
59250
59290
|
}
|
|
59251
59291
|
var pageInfoSelection = [
|
|
59292
|
+
{
|
|
59293
|
+
kind: graphql13.Kind.FIELD,
|
|
59294
|
+
name: {
|
|
59295
|
+
kind: graphql13.Kind.NAME,
|
|
59296
|
+
value: "pageInfo"
|
|
59297
|
+
},
|
|
59298
|
+
selectionSet: {
|
|
59299
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59300
|
+
selections: [
|
|
59301
|
+
{
|
|
59302
|
+
kind: graphql13.Kind.FIELD,
|
|
59303
|
+
name: {
|
|
59304
|
+
kind: graphql13.Kind.NAME,
|
|
59305
|
+
value: "hasPreviousPage"
|
|
59306
|
+
}
|
|
59307
|
+
},
|
|
59308
|
+
{
|
|
59309
|
+
kind: graphql13.Kind.FIELD,
|
|
59310
|
+
name: {
|
|
59311
|
+
kind: graphql13.Kind.NAME,
|
|
59312
|
+
value: "hasNextPage"
|
|
59313
|
+
}
|
|
59314
|
+
},
|
|
59315
|
+
{
|
|
59316
|
+
kind: graphql13.Kind.FIELD,
|
|
59317
|
+
name: {
|
|
59318
|
+
kind: graphql13.Kind.NAME,
|
|
59319
|
+
value: "startCursor"
|
|
59320
|
+
}
|
|
59321
|
+
},
|
|
59322
|
+
{
|
|
59323
|
+
kind: graphql13.Kind.FIELD,
|
|
59324
|
+
name: {
|
|
59325
|
+
kind: graphql13.Kind.NAME,
|
|
59326
|
+
value: "endCursor"
|
|
59327
|
+
}
|
|
59328
|
+
}
|
|
59329
|
+
]
|
|
59330
|
+
}
|
|
59331
|
+
},
|
|
59252
59332
|
{
|
|
59253
59333
|
kind: graphql13.Kind.FIELD,
|
|
59254
59334
|
name: {
|
|
@@ -54557,7 +54557,18 @@ var ListManager = class {
|
|
|
54557
54557
|
}
|
|
54558
54558
|
lists = /* @__PURE__ */ new Map();
|
|
54559
54559
|
listsByField = /* @__PURE__ */ new Map();
|
|
54560
|
-
get(listName, id, allLists) {
|
|
54560
|
+
get(listName, id, allLists, skipMatches) {
|
|
54561
|
+
const lists = this.getLists(listName, id, allLists);
|
|
54562
|
+
if (!lists) {
|
|
54563
|
+
return null;
|
|
54564
|
+
}
|
|
54565
|
+
if (skipMatches) {
|
|
54566
|
+
return new ListCollection(lists.lists.filter((list) => !skipMatches.has(list.fieldRef)));
|
|
54567
|
+
} else {
|
|
54568
|
+
return lists;
|
|
54569
|
+
}
|
|
54570
|
+
}
|
|
54571
|
+
getLists(listName, id, allLists) {
|
|
54561
54572
|
const matches = this.lists.get(listName);
|
|
54562
54573
|
if (!matches || matches.size === 0) {
|
|
54563
54574
|
return null;
|
|
@@ -54679,6 +54690,9 @@ var List = class {
|
|
|
54679
54690
|
this.manager = manager;
|
|
54680
54691
|
this.abstract = abstract;
|
|
54681
54692
|
}
|
|
54693
|
+
get fieldRef() {
|
|
54694
|
+
return `${this.recordID}.${this.key}`;
|
|
54695
|
+
}
|
|
54682
54696
|
when(when) {
|
|
54683
54697
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
54684
54698
|
}
|
|
@@ -55831,8 +55845,8 @@ var Cache = class {
|
|
|
55831
55845
|
variables
|
|
55832
55846
|
);
|
|
55833
55847
|
}
|
|
55834
|
-
list(name, parentID, allLists) {
|
|
55835
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
55848
|
+
list(name, parentID, allLists, skipMatches) {
|
|
55849
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
55836
55850
|
if (!handler) {
|
|
55837
55851
|
throw new Error(
|
|
55838
55852
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -56247,6 +56261,7 @@ var CacheInternal = class {
|
|
|
56247
56261
|
});
|
|
56248
56262
|
}
|
|
56249
56263
|
}
|
|
56264
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
56250
56265
|
for (const operation of operations || []) {
|
|
56251
56266
|
let parentID;
|
|
56252
56267
|
if (operation.parentID) {
|
|
@@ -56266,7 +56281,12 @@ var CacheInternal = class {
|
|
|
56266
56281
|
const targets = Array.isArray(value) ? value : [value];
|
|
56267
56282
|
for (const target of targets) {
|
|
56268
56283
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
56269
|
-
this.cache.list(
|
|
56284
|
+
this.cache.list(
|
|
56285
|
+
operation.list,
|
|
56286
|
+
parentID,
|
|
56287
|
+
operation.target === "all",
|
|
56288
|
+
processedOperations
|
|
56289
|
+
).when(operation.when).addToList(
|
|
56270
56290
|
fieldSelection,
|
|
56271
56291
|
target,
|
|
56272
56292
|
variables,
|
|
@@ -56274,7 +56294,12 @@ var CacheInternal = class {
|
|
|
56274
56294
|
layer
|
|
56275
56295
|
);
|
|
56276
56296
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
56277
|
-
this.cache.list(
|
|
56297
|
+
this.cache.list(
|
|
56298
|
+
operation.list,
|
|
56299
|
+
parentID,
|
|
56300
|
+
operation.target === "all",
|
|
56301
|
+
processedOperations
|
|
56302
|
+
).when(operation.when).toggleElement({
|
|
56278
56303
|
selection: fieldSelection,
|
|
56279
56304
|
data: target,
|
|
56280
56305
|
variables,
|
|
@@ -56282,7 +56307,12 @@ var CacheInternal = class {
|
|
|
56282
56307
|
layer
|
|
56283
56308
|
});
|
|
56284
56309
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
56285
|
-
this.cache.list(
|
|
56310
|
+
this.cache.list(
|
|
56311
|
+
operation.list,
|
|
56312
|
+
parentID,
|
|
56313
|
+
operation.target === "all",
|
|
56314
|
+
processedOperations
|
|
56315
|
+
).when(operation.when).remove(target, variables, layer);
|
|
56286
56316
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
56287
56317
|
const targetID = this.id(operation.type, target);
|
|
56288
56318
|
if (!targetID) {
|
|
@@ -56294,6 +56324,16 @@ var CacheInternal = class {
|
|
|
56294
56324
|
this.cache.delete(targetID, layer);
|
|
56295
56325
|
}
|
|
56296
56326
|
}
|
|
56327
|
+
if (operation.list) {
|
|
56328
|
+
const matchingLists = this.cache.list(
|
|
56329
|
+
operation.list,
|
|
56330
|
+
parentID,
|
|
56331
|
+
operation.target === "all"
|
|
56332
|
+
);
|
|
56333
|
+
for (const list of matchingLists.lists) {
|
|
56334
|
+
processedOperations.add(list.fieldRef);
|
|
56335
|
+
}
|
|
56336
|
+
}
|
|
56297
56337
|
}
|
|
56298
56338
|
}
|
|
56299
56339
|
return toNotify;
|
|
@@ -59248,6 +59288,46 @@ function objectNode([type, defaultValue]) {
|
|
|
59248
59288
|
return node;
|
|
59249
59289
|
}
|
|
59250
59290
|
var pageInfoSelection = [
|
|
59291
|
+
{
|
|
59292
|
+
kind: graphql13.Kind.FIELD,
|
|
59293
|
+
name: {
|
|
59294
|
+
kind: graphql13.Kind.NAME,
|
|
59295
|
+
value: "pageInfo"
|
|
59296
|
+
},
|
|
59297
|
+
selectionSet: {
|
|
59298
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59299
|
+
selections: [
|
|
59300
|
+
{
|
|
59301
|
+
kind: graphql13.Kind.FIELD,
|
|
59302
|
+
name: {
|
|
59303
|
+
kind: graphql13.Kind.NAME,
|
|
59304
|
+
value: "hasPreviousPage"
|
|
59305
|
+
}
|
|
59306
|
+
},
|
|
59307
|
+
{
|
|
59308
|
+
kind: graphql13.Kind.FIELD,
|
|
59309
|
+
name: {
|
|
59310
|
+
kind: graphql13.Kind.NAME,
|
|
59311
|
+
value: "hasNextPage"
|
|
59312
|
+
}
|
|
59313
|
+
},
|
|
59314
|
+
{
|
|
59315
|
+
kind: graphql13.Kind.FIELD,
|
|
59316
|
+
name: {
|
|
59317
|
+
kind: graphql13.Kind.NAME,
|
|
59318
|
+
value: "startCursor"
|
|
59319
|
+
}
|
|
59320
|
+
},
|
|
59321
|
+
{
|
|
59322
|
+
kind: graphql13.Kind.FIELD,
|
|
59323
|
+
name: {
|
|
59324
|
+
kind: graphql13.Kind.NAME,
|
|
59325
|
+
value: "endCursor"
|
|
59326
|
+
}
|
|
59327
|
+
}
|
|
59328
|
+
]
|
|
59329
|
+
}
|
|
59330
|
+
},
|
|
59251
59331
|
{
|
|
59252
59332
|
kind: graphql13.Kind.FIELD,
|
|
59253
59333
|
name: {
|