houdini 1.2.2 → 1.2.4
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 +183 -63
- package/build/cmd-esm/index.js +183 -63
- package/build/codegen-cjs/index.js +181 -61
- package/build/codegen-esm/index.js +181 -61
- package/build/lib/fs.d.ts +8 -1
- package/build/lib/index.d.ts +1 -0
- package/build/lib/parse.d.ts +1 -1
- package/build/lib/types.d.ts +11 -0
- package/build/lib-cjs/index.js +181 -69
- package/build/lib-esm/index.js +179 -69
- package/build/runtime/cache/cache.d.ts +5 -1
- package/build/runtime/cache/lists.d.ts +3 -3
- package/build/runtime/cache/storage.d.ts +8 -2
- package/build/runtime/cache/subscription.d.ts +1 -0
- package/build/runtime/client/documentStore.d.ts +9 -2
- package/build/runtime/client/index.d.ts +6 -3
- package/build/runtime/lib/index.d.ts +1 -0
- package/build/runtime/lib/lru.d.ts +52 -0
- package/build/runtime/lib/types.d.ts +1 -0
- package/build/runtime-cjs/cache/cache.d.ts +5 -1
- package/build/runtime-cjs/cache/cache.js +84 -27
- package/build/runtime-cjs/cache/lists.d.ts +3 -3
- package/build/runtime-cjs/cache/lists.js +20 -8
- package/build/runtime-cjs/cache/storage.d.ts +8 -2
- package/build/runtime-cjs/cache/storage.js +22 -5
- package/build/runtime-cjs/cache/subscription.d.ts +1 -0
- package/build/runtime-cjs/cache/subscription.js +3 -0
- package/build/runtime-cjs/client/documentStore.d.ts +9 -2
- package/build/runtime-cjs/client/documentStore.js +13 -9
- package/build/runtime-cjs/client/index.d.ts +6 -3
- package/build/runtime-cjs/client/index.js +6 -8
- package/build/runtime-cjs/client/plugins/cache.js +3 -0
- package/build/runtime-cjs/client/plugins/mutation.js +10 -6
- package/build/runtime-cjs/lib/index.d.ts +1 -0
- package/build/runtime-cjs/lib/index.js +1 -0
- package/build/runtime-cjs/lib/lru.d.ts +52 -0
- package/build/runtime-cjs/lib/lru.js +73 -0
- package/build/runtime-cjs/lib/types.d.ts +1 -0
- package/build/runtime-cjs/lib/types.js +7 -2
- package/build/runtime-esm/cache/cache.d.ts +5 -1
- package/build/runtime-esm/cache/cache.js +84 -27
- package/build/runtime-esm/cache/lists.d.ts +3 -3
- package/build/runtime-esm/cache/lists.js +20 -8
- package/build/runtime-esm/cache/storage.d.ts +8 -2
- package/build/runtime-esm/cache/storage.js +22 -5
- package/build/runtime-esm/cache/subscription.d.ts +1 -0
- package/build/runtime-esm/cache/subscription.js +3 -0
- package/build/runtime-esm/client/documentStore.d.ts +9 -2
- package/build/runtime-esm/client/documentStore.js +13 -9
- package/build/runtime-esm/client/index.d.ts +6 -3
- package/build/runtime-esm/client/index.js +6 -8
- package/build/runtime-esm/client/plugins/cache.js +3 -0
- package/build/runtime-esm/client/plugins/mutation.js +10 -6
- package/build/runtime-esm/lib/index.d.ts +1 -0
- package/build/runtime-esm/lib/index.js +1 -0
- package/build/runtime-esm/lib/lru.d.ts +52 -0
- package/build/runtime-esm/lib/lru.js +48 -0
- package/build/runtime-esm/lib/types.d.ts +1 -0
- package/build/runtime-esm/lib/types.js +5 -1
- package/build/test-cjs/index.js +181 -61
- package/build/test-esm/index.js +181 -61
- package/build/vite-cjs/index.js +200 -62
- package/build/vite-esm/index.js +200 -62
- package/package.json +1 -1
|
@@ -54386,6 +54386,7 @@ __export(fs_exports, {
|
|
|
54386
54386
|
recursiveCopy: () => recursiveCopy,
|
|
54387
54387
|
remove: () => remove,
|
|
54388
54388
|
rmdir: () => rmdir,
|
|
54389
|
+
snapshot: () => snapshot,
|
|
54389
54390
|
stat: () => stat,
|
|
54390
54391
|
writeFile: () => writeFile
|
|
54391
54392
|
});
|
|
@@ -54580,16 +54581,17 @@ function existsSync(dirPath) {
|
|
|
54580
54581
|
}
|
|
54581
54582
|
return import_memfs.fs.existsSync(dirPath);
|
|
54582
54583
|
}
|
|
54583
|
-
async function readdir(filepath) {
|
|
54584
|
+
async function readdir(filepath, opts) {
|
|
54584
54585
|
if (!houdini_mode.is_testing) {
|
|
54585
|
-
return await import_promises.default.readdir(filepath);
|
|
54586
|
+
return await import_promises.default.readdir(filepath, opts);
|
|
54586
54587
|
}
|
|
54587
54588
|
if (filepath.includes("build/runtime")) {
|
|
54588
|
-
return await import_promises.default.readdir(filepath);
|
|
54589
|
+
return await import_promises.default.readdir(filepath, opts);
|
|
54589
54590
|
}
|
|
54590
54591
|
try {
|
|
54591
|
-
return import_memfs.fs.readdirSync(filepath);
|
|
54592
|
-
} catch {
|
|
54592
|
+
return import_memfs.fs.readdirSync(filepath, opts);
|
|
54593
|
+
} catch (e) {
|
|
54594
|
+
console.log(e);
|
|
54593
54595
|
return [];
|
|
54594
54596
|
}
|
|
54595
54597
|
}
|
|
@@ -54640,6 +54642,11 @@ async function recursiveCopy(source, target, transforms, notRoot) {
|
|
|
54640
54642
|
);
|
|
54641
54643
|
}
|
|
54642
54644
|
}
|
|
54645
|
+
function snapshot(base) {
|
|
54646
|
+
return Object.fromEntries(
|
|
54647
|
+
Object.entries(import_memfs.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value]) => [!base ? key : key.substring(base.length), value])
|
|
54648
|
+
);
|
|
54649
|
+
}
|
|
54643
54650
|
async function glob(pattern) {
|
|
54644
54651
|
return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
|
|
54645
54652
|
}
|
|
@@ -54771,10 +54778,10 @@ var ListManager = class {
|
|
|
54771
54778
|
this.lists.get(list.name).get(parentID).lists.push(handler);
|
|
54772
54779
|
this.listsByField.get(parentID).get(list.key).push(handler);
|
|
54773
54780
|
}
|
|
54774
|
-
removeIDFromAllLists(id) {
|
|
54781
|
+
removeIDFromAllLists(id, layer) {
|
|
54775
54782
|
for (const fieldMap of this.lists.values()) {
|
|
54776
54783
|
for (const list of fieldMap.values()) {
|
|
54777
|
-
list.removeID(id);
|
|
54784
|
+
list.removeID(id, void 0, layer);
|
|
54778
54785
|
}
|
|
54779
54786
|
}
|
|
54780
54787
|
}
|
|
@@ -54871,6 +54878,10 @@ var List = class {
|
|
|
54871
54878
|
updates: ["append", "prepend"],
|
|
54872
54879
|
selection: {
|
|
54873
54880
|
fields: {
|
|
54881
|
+
__typename: {
|
|
54882
|
+
keyRaw: "__typename",
|
|
54883
|
+
type: "String"
|
|
54884
|
+
},
|
|
54874
54885
|
node: {
|
|
54875
54886
|
type: listType,
|
|
54876
54887
|
keyRaw: "node",
|
|
@@ -54895,7 +54906,15 @@ var List = class {
|
|
|
54895
54906
|
};
|
|
54896
54907
|
insertData = {
|
|
54897
54908
|
newEntry: {
|
|
54898
|
-
edges: [
|
|
54909
|
+
edges: [
|
|
54910
|
+
{
|
|
54911
|
+
__typename: listType + "Edge",
|
|
54912
|
+
node: {
|
|
54913
|
+
...data,
|
|
54914
|
+
__typename: listType
|
|
54915
|
+
}
|
|
54916
|
+
}
|
|
54917
|
+
]
|
|
54899
54918
|
}
|
|
54900
54919
|
};
|
|
54901
54920
|
} else {
|
|
@@ -54931,7 +54950,7 @@ var List = class {
|
|
|
54931
54950
|
layer: layer?.id
|
|
54932
54951
|
});
|
|
54933
54952
|
}
|
|
54934
|
-
removeID(id, variables = {}) {
|
|
54953
|
+
removeID(id, variables = {}, layer) {
|
|
54935
54954
|
if (!this.validateWhen()) {
|
|
54936
54955
|
return;
|
|
54937
54956
|
}
|
|
@@ -54978,7 +54997,7 @@ var List = class {
|
|
|
54978
54997
|
subscribers.map((sub) => sub[0]),
|
|
54979
54998
|
variables
|
|
54980
54999
|
);
|
|
54981
|
-
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
|
|
55000
|
+
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID, layer);
|
|
54982
55001
|
for (const [spec] of subscribers) {
|
|
54983
55002
|
spec.set(
|
|
54984
55003
|
this.cache._internal_unstable.getSelection({
|
|
@@ -54991,12 +55010,12 @@ var List = class {
|
|
|
54991
55010
|
}
|
|
54992
55011
|
return true;
|
|
54993
55012
|
}
|
|
54994
|
-
remove(data, variables = {}) {
|
|
55013
|
+
remove(data, variables = {}, layer) {
|
|
54995
55014
|
const targetID = this.cache._internal_unstable.id(this.listType(data), data);
|
|
54996
55015
|
if (!targetID) {
|
|
54997
55016
|
return;
|
|
54998
55017
|
}
|
|
54999
|
-
return this.removeID(targetID, variables);
|
|
55018
|
+
return this.removeID(targetID, variables, layer);
|
|
55000
55019
|
}
|
|
55001
55020
|
listType(data) {
|
|
55002
55021
|
return data.__typename || this.type;
|
|
@@ -55028,7 +55047,7 @@ var List = class {
|
|
|
55028
55047
|
layer,
|
|
55029
55048
|
where
|
|
55030
55049
|
}) {
|
|
55031
|
-
if (!this.remove(data, variables)) {
|
|
55050
|
+
if (!this.remove(data, variables, layer)) {
|
|
55032
55051
|
this.addToList(selection, data, variables, where, layer);
|
|
55033
55052
|
}
|
|
55034
55053
|
}
|
|
@@ -55165,7 +55184,7 @@ var StaleManager = class {
|
|
|
55165
55184
|
// src/runtime/cache/storage.ts
|
|
55166
55185
|
var InMemoryStorage = class {
|
|
55167
55186
|
data;
|
|
55168
|
-
idCount =
|
|
55187
|
+
idCount = 1;
|
|
55169
55188
|
rank = 0;
|
|
55170
55189
|
constructor() {
|
|
55171
55190
|
this.data = [];
|
|
@@ -55185,11 +55204,11 @@ var InMemoryStorage = class {
|
|
|
55185
55204
|
insert(id, field, location, target) {
|
|
55186
55205
|
return this.topLayer.insert(id, field, location, target);
|
|
55187
55206
|
}
|
|
55188
|
-
remove(id, field, target) {
|
|
55189
|
-
return
|
|
55207
|
+
remove(id, field, target, layerToUser = this.topLayer) {
|
|
55208
|
+
return layerToUser.remove(id, field, target);
|
|
55190
55209
|
}
|
|
55191
|
-
delete(id) {
|
|
55192
|
-
return
|
|
55210
|
+
delete(id, layerToUser = this.topLayer) {
|
|
55211
|
+
return layerToUser.delete(id);
|
|
55193
55212
|
}
|
|
55194
55213
|
deleteField(id, field) {
|
|
55195
55214
|
return this.topLayer.deleteField(id, field);
|
|
@@ -55323,6 +55342,23 @@ var InMemoryStorage = class {
|
|
|
55323
55342
|
}
|
|
55324
55343
|
return this.data[this.data.length - 1];
|
|
55325
55344
|
}
|
|
55345
|
+
serialize() {
|
|
55346
|
+
return JSON.stringify({
|
|
55347
|
+
rank: this.rank,
|
|
55348
|
+
fields: this.topLayer.fields,
|
|
55349
|
+
links: this.topLayer.links
|
|
55350
|
+
});
|
|
55351
|
+
}
|
|
55352
|
+
hydrate(args, layer) {
|
|
55353
|
+
if (!args) {
|
|
55354
|
+
return;
|
|
55355
|
+
}
|
|
55356
|
+
const { rank, fields, links } = args;
|
|
55357
|
+
this.rank = rank;
|
|
55358
|
+
layer ??= this.createLayer(true);
|
|
55359
|
+
layer.fields = fields;
|
|
55360
|
+
layer.links = links;
|
|
55361
|
+
}
|
|
55326
55362
|
};
|
|
55327
55363
|
var Layer = class {
|
|
55328
55364
|
id;
|
|
@@ -55561,6 +55597,9 @@ var InMemorySubscriptions = class {
|
|
|
55561
55597
|
subscribers = {};
|
|
55562
55598
|
referenceCounts = {};
|
|
55563
55599
|
keyVersions = {};
|
|
55600
|
+
activeFields(parent2) {
|
|
55601
|
+
return Object.keys(this.subscribers[parent2] || {});
|
|
55602
|
+
}
|
|
55564
55603
|
add({
|
|
55565
55604
|
parent: parent2,
|
|
55566
55605
|
spec,
|
|
@@ -55829,20 +55868,7 @@ var Cache = class {
|
|
|
55829
55868
|
}) {
|
|
55830
55869
|
const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
|
|
55831
55870
|
const subscribers = this._internal_unstable.writeSelection({ ...args, layer }).map((sub) => sub[0]);
|
|
55832
|
-
|
|
55833
|
-
for (const spec of subscribers.concat(notifySubscribers)) {
|
|
55834
|
-
if (!notified.includes(spec.set)) {
|
|
55835
|
-
notified.push(spec.set);
|
|
55836
|
-
spec.set(
|
|
55837
|
-
this._internal_unstable.getSelection({
|
|
55838
|
-
parent: spec.parentID || rootID,
|
|
55839
|
-
selection: spec.selection,
|
|
55840
|
-
variables: spec.variables?.() || {},
|
|
55841
|
-
ignoreMasking: false
|
|
55842
|
-
}).data
|
|
55843
|
-
);
|
|
55844
|
-
}
|
|
55845
|
-
}
|
|
55871
|
+
this.#notifySubscribers(subscribers.concat(notifySubscribers));
|
|
55846
55872
|
return subscribers;
|
|
55847
55873
|
}
|
|
55848
55874
|
read(...args) {
|
|
@@ -55881,10 +55907,10 @@ var Cache = class {
|
|
|
55881
55907
|
}
|
|
55882
55908
|
return handler;
|
|
55883
55909
|
}
|
|
55884
|
-
delete(id) {
|
|
55910
|
+
delete(id, layer) {
|
|
55885
55911
|
this._internal_unstable.subscriptions.removeAllSubscribers(id);
|
|
55886
|
-
this._internal_unstable.lists.removeIDFromAllLists(id);
|
|
55887
|
-
this._internal_unstable.storage.delete(id);
|
|
55912
|
+
this._internal_unstable.lists.removeIDFromAllLists(id, layer);
|
|
55913
|
+
this._internal_unstable.storage.delete(id, layer);
|
|
55888
55914
|
}
|
|
55889
55915
|
setConfig(config2) {
|
|
55890
55916
|
this._internal_unstable.setConfig(config2);
|
|
@@ -55916,6 +55942,76 @@ var Cache = class {
|
|
|
55916
55942
|
config() {
|
|
55917
55943
|
return this._internal_unstable.config;
|
|
55918
55944
|
}
|
|
55945
|
+
serialize() {
|
|
55946
|
+
return this._internal_unstable.storage.serialize();
|
|
55947
|
+
}
|
|
55948
|
+
hydrate(...args) {
|
|
55949
|
+
return this._internal_unstable.storage.hydrate(...args);
|
|
55950
|
+
}
|
|
55951
|
+
clearLayer(layerID) {
|
|
55952
|
+
const layer = this._internal_unstable.storage.getLayer(layerID);
|
|
55953
|
+
if (!layer) {
|
|
55954
|
+
throw new Error("Cannot find layer with id: " + layerID);
|
|
55955
|
+
}
|
|
55956
|
+
const toNotify = [];
|
|
55957
|
+
const allFields = [];
|
|
55958
|
+
for (const target of [layer.fields, layer.links]) {
|
|
55959
|
+
for (const [id, fields] of Object.entries(target)) {
|
|
55960
|
+
allFields.push(
|
|
55961
|
+
...Object.entries(fields).map(([field, value]) => ({ id, field, value }))
|
|
55962
|
+
);
|
|
55963
|
+
}
|
|
55964
|
+
}
|
|
55965
|
+
const displayFields = [];
|
|
55966
|
+
for (const pair of allFields) {
|
|
55967
|
+
const { displayLayers } = this._internal_unstable.storage.get(pair.id, pair.field);
|
|
55968
|
+
if (!displayLayers.includes(layerID)) {
|
|
55969
|
+
continue;
|
|
55970
|
+
}
|
|
55971
|
+
displayFields.push(pair);
|
|
55972
|
+
}
|
|
55973
|
+
for (const [id, operation] of Object.entries(layer.operations)) {
|
|
55974
|
+
if (operation.deleted) {
|
|
55975
|
+
displayFields.push(
|
|
55976
|
+
...this._internal_unstable.subscriptions.activeFields(id).map((field) => ({ id, field }))
|
|
55977
|
+
);
|
|
55978
|
+
}
|
|
55979
|
+
const fields = Object.keys(operation.fields ?? {});
|
|
55980
|
+
if (fields.length > 0) {
|
|
55981
|
+
displayFields.push(...fields.map((field) => ({ id, field })));
|
|
55982
|
+
}
|
|
55983
|
+
}
|
|
55984
|
+
layer.clear();
|
|
55985
|
+
for (const display of displayFields) {
|
|
55986
|
+
const { field, id } = display;
|
|
55987
|
+
const notify = !("value" in display) || this._internal_unstable.storage.get(id, field).value !== display.value;
|
|
55988
|
+
if (notify) {
|
|
55989
|
+
toNotify.push(
|
|
55990
|
+
...this._internal_unstable.subscriptions.get(id, field).map((sub) => sub[0])
|
|
55991
|
+
);
|
|
55992
|
+
}
|
|
55993
|
+
}
|
|
55994
|
+
this.#notifySubscribers(toNotify);
|
|
55995
|
+
}
|
|
55996
|
+
#notifySubscribers(subs) {
|
|
55997
|
+
if (subs.length === 0) {
|
|
55998
|
+
return;
|
|
55999
|
+
}
|
|
56000
|
+
const notified = [];
|
|
56001
|
+
for (const spec of subs) {
|
|
56002
|
+
if (!notified.includes(spec.set)) {
|
|
56003
|
+
notified.push(spec.set);
|
|
56004
|
+
spec.set(
|
|
56005
|
+
this._internal_unstable.getSelection({
|
|
56006
|
+
parent: spec.parentID || rootID,
|
|
56007
|
+
selection: spec.selection,
|
|
56008
|
+
variables: spec.variables?.() || {},
|
|
56009
|
+
ignoreMasking: false
|
|
56010
|
+
}).data
|
|
56011
|
+
);
|
|
56012
|
+
}
|
|
56013
|
+
}
|
|
56014
|
+
}
|
|
55919
56015
|
};
|
|
55920
56016
|
var CacheInternal = class {
|
|
55921
56017
|
_disabled = false;
|
|
@@ -56203,8 +56299,16 @@ var CacheInternal = class {
|
|
|
56203
56299
|
operation.position || "last",
|
|
56204
56300
|
layer
|
|
56205
56301
|
);
|
|
56302
|
+
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
56303
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
|
|
56304
|
+
selection: fieldSelection,
|
|
56305
|
+
data: target,
|
|
56306
|
+
variables,
|
|
56307
|
+
where: operation.position || "last",
|
|
56308
|
+
layer
|
|
56309
|
+
});
|
|
56206
56310
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
56207
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
56311
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables, layer);
|
|
56208
56312
|
} else if (operation.action === "delete" && operation.type) {
|
|
56209
56313
|
if (typeof target !== "string") {
|
|
56210
56314
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -56213,15 +56317,7 @@ var CacheInternal = class {
|
|
|
56213
56317
|
if (!targetID) {
|
|
56214
56318
|
continue;
|
|
56215
56319
|
}
|
|
56216
|
-
this.cache.delete(targetID);
|
|
56217
|
-
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
56218
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
|
|
56219
|
-
selection: fieldSelection,
|
|
56220
|
-
data: target,
|
|
56221
|
-
variables,
|
|
56222
|
-
where: operation.position || "last",
|
|
56223
|
-
layer
|
|
56224
|
-
});
|
|
56320
|
+
this.cache.delete(targetID, layer);
|
|
56225
56321
|
}
|
|
56226
56322
|
}
|
|
56227
56323
|
}
|
|
@@ -56756,7 +56852,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
56756
56852
|
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
56757
56853
|
return {
|
|
56758
56854
|
async start(ctx, { next, marshalVariables }) {
|
|
56759
|
-
const
|
|
56855
|
+
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
56760
56856
|
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
56761
56857
|
let toNotify = [];
|
|
56762
56858
|
if (optimisticResponse) {
|
|
@@ -56767,25 +56863,29 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
56767
56863
|
data: optimisticResponse
|
|
56768
56864
|
}),
|
|
56769
56865
|
variables: marshalVariables(ctx),
|
|
56770
|
-
layer:
|
|
56866
|
+
layer: layerOptimistic.id
|
|
56771
56867
|
});
|
|
56772
56868
|
}
|
|
56773
56869
|
ctx.cacheParams = {
|
|
56774
56870
|
...ctx.cacheParams,
|
|
56775
|
-
layer,
|
|
56871
|
+
layer: layerOptimistic,
|
|
56776
56872
|
notifySubscribers: toNotify,
|
|
56777
56873
|
forceNotify: true
|
|
56778
56874
|
};
|
|
56779
56875
|
next(ctx);
|
|
56780
56876
|
},
|
|
56781
56877
|
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
56782
|
-
ctx.cacheParams?.layer
|
|
56878
|
+
if (ctx.cacheParams?.layer) {
|
|
56879
|
+
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
56880
|
+
}
|
|
56783
56881
|
resolve2(ctx);
|
|
56784
56882
|
},
|
|
56785
56883
|
end(ctx, { resolve: resolve2, value }) {
|
|
56786
56884
|
const hasErrors = value.errors && value.errors.length > 0;
|
|
56787
56885
|
if (hasErrors) {
|
|
56788
|
-
ctx.cacheParams?.layer
|
|
56886
|
+
if (ctx.cacheParams?.layer) {
|
|
56887
|
+
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
56888
|
+
}
|
|
56789
56889
|
}
|
|
56790
56890
|
if (ctx.cacheParams?.layer) {
|
|
56791
56891
|
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
@@ -56795,7 +56895,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
56795
56895
|
catch(ctx, { error }) {
|
|
56796
56896
|
if (ctx.cacheParams?.layer) {
|
|
56797
56897
|
const { layer } = ctx.cacheParams;
|
|
56798
|
-
layer.
|
|
56898
|
+
cache_default.clearLayer(layer.id);
|
|
56799
56899
|
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
56800
56900
|
}
|
|
56801
56901
|
throw error;
|
|
@@ -56999,7 +57099,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
56999
57099
|
}
|
|
57000
57100
|
|
|
57001
57101
|
// src/lib/parse.ts
|
|
57002
|
-
|
|
57102
|
+
function parseJS(str, config2) {
|
|
57003
57103
|
const defaultConfig = {
|
|
57004
57104
|
plugins: ["typescript", "importAssertions"],
|
|
57005
57105
|
sourceType: "module"
|
|
@@ -58410,7 +58510,7 @@ function operationObject({
|
|
|
58410
58510
|
if (operationKind === "insert" || operationKind === "toggle") {
|
|
58411
58511
|
operation.position = position;
|
|
58412
58512
|
}
|
|
58413
|
-
if (operationKind
|
|
58513
|
+
if (allLists && operationKind !== "delete") {
|
|
58414
58514
|
operation.target = "all";
|
|
58415
58515
|
}
|
|
58416
58516
|
if (parentID) {
|
|
@@ -60246,12 +60346,28 @@ ${exportStatement("config")}
|
|
|
60246
60346
|
},
|
|
60247
60347
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
60248
60348
|
}),
|
|
60249
|
-
...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
|
|
60349
|
+
...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
|
|
60350
|
+
(plugin2) => generatePluginRuntime({
|
|
60351
|
+
config: config2,
|
|
60352
|
+
docs,
|
|
60353
|
+
plugin: plugin2,
|
|
60354
|
+
importStatement,
|
|
60355
|
+
exportDefaultStatement: exportStatement,
|
|
60356
|
+
exportStarStatement: exportStar
|
|
60357
|
+
})
|
|
60358
|
+
),
|
|
60250
60359
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
60251
60360
|
]);
|
|
60252
60361
|
await generateGraphqlReturnTypes(config2, docs);
|
|
60253
60362
|
}
|
|
60254
|
-
async function generatePluginRuntime(
|
|
60363
|
+
async function generatePluginRuntime({
|
|
60364
|
+
config: config2,
|
|
60365
|
+
docs,
|
|
60366
|
+
plugin: plugin2,
|
|
60367
|
+
importStatement,
|
|
60368
|
+
exportDefaultStatement,
|
|
60369
|
+
exportStarStatement
|
|
60370
|
+
}) {
|
|
60255
60371
|
if (houdini_mode.is_testing || !plugin2.includeRuntime) {
|
|
60256
60372
|
return;
|
|
60257
60373
|
}
|
|
@@ -60279,7 +60395,13 @@ async function generatePluginRuntime(config2, docs, plugin2) {
|
|
|
60279
60395
|
Object.fromEntries(
|
|
60280
60396
|
Object.entries(transformMap).map(([key, value]) => [
|
|
60281
60397
|
path_exports.join(runtime_path, key),
|
|
60282
|
-
(content) => value({
|
|
60398
|
+
(content) => value({
|
|
60399
|
+
config: config2,
|
|
60400
|
+
content,
|
|
60401
|
+
importStatement,
|
|
60402
|
+
exportDefaultStatement,
|
|
60403
|
+
exportStarStatement
|
|
60404
|
+
})
|
|
60283
60405
|
])
|
|
60284
60406
|
)
|
|
60285
60407
|
);
|
|
@@ -62147,14 +62269,12 @@ async function typeCheck(config2, docs) {
|
|
|
62147
62269
|
for (const targetType of targetTypes) {
|
|
62148
62270
|
const missingIDFields = config2.keyFieldsForType(targetType.name).filter((fieldName) => !targetType.getFields()[fieldName]);
|
|
62149
62271
|
if (missingIDFields.length > 0) {
|
|
62150
|
-
const message = `@${config2.listDirective} on ${logGreen(
|
|
62151
|
-
targetType.name
|
|
62152
|
-
)} as a configuration issue. Object identification missing: ${missingIDFields.map((c) => `"${logYellow(c)}"`).join(", ")}. Check 'Custom IDs' if needed.`;
|
|
62153
62272
|
errors.push(
|
|
62154
62273
|
new HoudiniError({
|
|
62155
62274
|
filepath: filename,
|
|
62156
|
-
message
|
|
62157
|
-
|
|
62275
|
+
message: `@${config2.listDirective} on ${logGreen(
|
|
62276
|
+
targetType.name
|
|
62277
|
+
)} has a configuration issue: ${targetType} dos not have a valid key. Please check this link for more information: https://houdinigraphql.com/guides/caching-data#custom-ids`
|
|
62158
62278
|
})
|
|
62159
62279
|
);
|
|
62160
62280
|
return;
|