houdini-svelte 1.1.1 → 1.1.3

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.
@@ -90604,13 +90604,23 @@ var List = class {
90604
90604
  when(when) {
90605
90605
  return this.manager.lists.get(this.name).get(this.recordID).when(when);
90606
90606
  }
90607
- append(selection, data2, variables = {}) {
90608
- return this.addToList(selection, data2, variables, "last");
90607
+ append({
90608
+ selection,
90609
+ data: data2,
90610
+ variables = {},
90611
+ layer
90612
+ }) {
90613
+ return this.addToList(selection, data2, variables, "last", layer);
90609
90614
  }
90610
- prepend(selection, data2, variables = {}) {
90611
- return this.addToList(selection, data2, variables, "first");
90615
+ prepend({
90616
+ selection,
90617
+ data: data2,
90618
+ variables = {},
90619
+ layer
90620
+ }) {
90621
+ return this.addToList(selection, data2, variables, "first", layer);
90612
90622
  }
90613
- addToList(selection, data2, variables = {}, where) {
90623
+ addToList(selection, data2, variables = {}, where, layer) {
90614
90624
  const listType = this.listType(data2);
90615
90625
  const dataID = this.cache._internal_unstable.id(listType, data2);
90616
90626
  if (!this.validateWhen() || !dataID) {
@@ -90688,7 +90698,8 @@ var List = class {
90688
90698
  data: insertData,
90689
90699
  variables,
90690
90700
  parent: this.recordID,
90691
- applyUpdates: [where === "first" ? "prepend" : "append"]
90701
+ applyUpdates: [where === "first" ? "prepend" : "append"],
90702
+ layer: layer?.id
90692
90703
  });
90693
90704
  }
90694
90705
  removeID(id2, variables = {}) {
@@ -90781,9 +90792,15 @@ var List = class {
90781
90792
  }
90782
90793
  return ok;
90783
90794
  }
90784
- toggleElement(selection, data2, variables = {}, where) {
90795
+ toggleElement({
90796
+ selection,
90797
+ data: data2,
90798
+ variables = {},
90799
+ layer,
90800
+ where
90801
+ }) {
90785
90802
  if (!this.remove(data2, variables)) {
90786
- this.addToList(selection, data2, variables, where);
90803
+ this.addToList(selection, data2, variables, where, layer);
90787
90804
  }
90788
90805
  }
90789
90806
  *[Symbol.iterator]() {
@@ -91779,6 +91796,9 @@ var CacheInternal = class {
91779
91796
  nullable,
91780
91797
  link: !!fieldSelection
91781
91798
  });
91799
+ if (value2 && typeof value2 === "object" && "__typename" in value2 && value2["__typename"]) {
91800
+ linkedType = value2["__typename"];
91801
+ }
91782
91802
  const currentSubscribers = this.subscriptions.get(parent, key);
91783
91803
  const specs = currentSubscribers.map((sub) => sub[0]);
91784
91804
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -91832,7 +91852,6 @@ var CacheInternal = class {
91832
91852
  "Encountered interface type without __typename in the payload"
91833
91853
  );
91834
91854
  }
91835
- linkedType = value2.__typename;
91836
91855
  }
91837
91856
  const embedded = this.idFields(linkedType)?.filter(
91838
91857
  (field2) => typeof value2[field2] === "undefined"
@@ -91988,7 +92007,8 @@ var CacheInternal = class {
91988
92007
  fieldSelection,
91989
92008
  target,
91990
92009
  variables,
91991
- operation.position || "last"
92010
+ operation.position || "last",
92011
+ layer
91992
92012
  );
91993
92013
  } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
91994
92014
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
@@ -92002,12 +92022,13 @@ var CacheInternal = class {
92002
92022
  }
92003
92023
  this.cache.delete(targetID);
92004
92024
  } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
92005
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
92006
- fieldSelection,
92007
- target,
92025
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
92026
+ selection: fieldSelection,
92027
+ data: target,
92008
92028
  variables,
92009
- operation.position || "last"
92010
- );
92029
+ where: operation.position || "last",
92030
+ layer
92031
+ });
92011
92032
  }
92012
92033
  }
92013
92034
  }
@@ -92036,7 +92057,7 @@ var CacheInternal = class {
92036
92057
  ])
92037
92058
  );
92038
92059
  }
92039
- let hasData = false;
92060
+ let hasData = !!selection.fragments;
92040
92061
  let partial = false;
92041
92062
  let cascadeNull = false;
92042
92063
  let stale = false;
@@ -92251,13 +92272,12 @@ var CacheInternal = class {
92251
92272
  const embedded = this.idFields(linkedType)?.filter(
92252
92273
  (field) => typeof entry[field] === "undefined"
92253
92274
  ).length > 0;
92254
- const typename = entryObj.__typename;
92255
92275
  let innerType = linkedType;
92256
- if (abstract) {
92257
- if (!typename) {
92258
- throw new Error("Encountered interface type without __typename in the payload");
92259
- }
92276
+ const typename = entryObj.__typename;
92277
+ if (typename) {
92260
92278
  innerType = typename;
92279
+ } else if (abstract) {
92280
+ throw new Error("Encountered interface type without __typename in the payload");
92261
92281
  }
92262
92282
  if (!embedded) {
92263
92283
  const id2 = this.id(innerType, entry);
@@ -155832,13 +155852,23 @@ var List2 = class {
155832
155852
  when(when) {
155833
155853
  return this.manager.lists.get(this.name).get(this.recordID).when(when);
155834
155854
  }
155835
- append(selection, data2, variables = {}) {
155836
- return this.addToList(selection, data2, variables, "last");
155855
+ append({
155856
+ selection,
155857
+ data: data2,
155858
+ variables = {},
155859
+ layer
155860
+ }) {
155861
+ return this.addToList(selection, data2, variables, "last", layer);
155837
155862
  }
155838
- prepend(selection, data2, variables = {}) {
155839
- return this.addToList(selection, data2, variables, "first");
155863
+ prepend({
155864
+ selection,
155865
+ data: data2,
155866
+ variables = {},
155867
+ layer
155868
+ }) {
155869
+ return this.addToList(selection, data2, variables, "first", layer);
155840
155870
  }
155841
- addToList(selection, data2, variables = {}, where) {
155871
+ addToList(selection, data2, variables = {}, where, layer) {
155842
155872
  const listType = this.listType(data2);
155843
155873
  const dataID = this.cache._internal_unstable.id(listType, data2);
155844
155874
  if (!this.validateWhen() || !dataID) {
@@ -155916,7 +155946,8 @@ var List2 = class {
155916
155946
  data: insertData,
155917
155947
  variables,
155918
155948
  parent: this.recordID,
155919
- applyUpdates: [where === "first" ? "prepend" : "append"]
155949
+ applyUpdates: [where === "first" ? "prepend" : "append"],
155950
+ layer: layer?.id
155920
155951
  });
155921
155952
  }
155922
155953
  removeID(id2, variables = {}) {
@@ -156009,9 +156040,15 @@ var List2 = class {
156009
156040
  }
156010
156041
  return ok;
156011
156042
  }
156012
- toggleElement(selection, data2, variables = {}, where) {
156043
+ toggleElement({
156044
+ selection,
156045
+ data: data2,
156046
+ variables = {},
156047
+ layer,
156048
+ where
156049
+ }) {
156013
156050
  if (!this.remove(data2, variables)) {
156014
- this.addToList(selection, data2, variables, where);
156051
+ this.addToList(selection, data2, variables, where, layer);
156015
156052
  }
156016
156053
  }
156017
156054
  *[Symbol.iterator]() {
@@ -157007,6 +157044,9 @@ var CacheInternal2 = class {
157007
157044
  nullable,
157008
157045
  link: !!fieldSelection
157009
157046
  });
157047
+ if (value2 && typeof value2 === "object" && "__typename" in value2 && value2["__typename"]) {
157048
+ linkedType = value2["__typename"];
157049
+ }
157010
157050
  const currentSubscribers = this.subscriptions.get(parent, key);
157011
157051
  const specs = currentSubscribers.map((sub) => sub[0]);
157012
157052
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -157060,7 +157100,6 @@ var CacheInternal2 = class {
157060
157100
  "Encountered interface type without __typename in the payload"
157061
157101
  );
157062
157102
  }
157063
- linkedType = value2.__typename;
157064
157103
  }
157065
157104
  const embedded = this.idFields(linkedType)?.filter(
157066
157105
  (field2) => typeof value2[field2] === "undefined"
@@ -157216,7 +157255,8 @@ var CacheInternal2 = class {
157216
157255
  fieldSelection,
157217
157256
  target,
157218
157257
  variables,
157219
- operation.position || "last"
157258
+ operation.position || "last",
157259
+ layer
157220
157260
  );
157221
157261
  } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
157222
157262
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
@@ -157230,12 +157270,13 @@ var CacheInternal2 = class {
157230
157270
  }
157231
157271
  this.cache.delete(targetID);
157232
157272
  } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
157233
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
157234
- fieldSelection,
157235
- target,
157273
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
157274
+ selection: fieldSelection,
157275
+ data: target,
157236
157276
  variables,
157237
- operation.position || "last"
157238
- );
157277
+ where: operation.position || "last",
157278
+ layer
157279
+ });
157239
157280
  }
157240
157281
  }
157241
157282
  }
@@ -157264,7 +157305,7 @@ var CacheInternal2 = class {
157264
157305
  ])
157265
157306
  );
157266
157307
  }
157267
- let hasData = false;
157308
+ let hasData = !!selection.fragments;
157268
157309
  let partial = false;
157269
157310
  let cascadeNull = false;
157270
157311
  let stale = false;
@@ -157479,13 +157520,12 @@ var CacheInternal2 = class {
157479
157520
  const embedded = this.idFields(linkedType)?.filter(
157480
157521
  (field) => typeof entry[field] === "undefined"
157481
157522
  ).length > 0;
157482
- const typename = entryObj.__typename;
157483
157523
  let innerType = linkedType;
157484
- if (abstract) {
157485
- if (!typename) {
157486
- throw new Error("Encountered interface type without __typename in the payload");
157487
- }
157524
+ const typename = entryObj.__typename;
157525
+ if (typename) {
157488
157526
  innerType = typename;
157527
+ } else if (abstract) {
157528
+ throw new Error("Encountered interface type without __typename in the payload");
157489
157529
  }
157490
157530
  if (!embedded) {
157491
157531
  const id2 = this.id(innerType, entry);
@@ -90595,13 +90595,23 @@ var List = class {
90595
90595
  when(when) {
90596
90596
  return this.manager.lists.get(this.name).get(this.recordID).when(when);
90597
90597
  }
90598
- append(selection, data2, variables = {}) {
90599
- return this.addToList(selection, data2, variables, "last");
90598
+ append({
90599
+ selection,
90600
+ data: data2,
90601
+ variables = {},
90602
+ layer
90603
+ }) {
90604
+ return this.addToList(selection, data2, variables, "last", layer);
90600
90605
  }
90601
- prepend(selection, data2, variables = {}) {
90602
- return this.addToList(selection, data2, variables, "first");
90606
+ prepend({
90607
+ selection,
90608
+ data: data2,
90609
+ variables = {},
90610
+ layer
90611
+ }) {
90612
+ return this.addToList(selection, data2, variables, "first", layer);
90603
90613
  }
90604
- addToList(selection, data2, variables = {}, where) {
90614
+ addToList(selection, data2, variables = {}, where, layer) {
90605
90615
  const listType = this.listType(data2);
90606
90616
  const dataID = this.cache._internal_unstable.id(listType, data2);
90607
90617
  if (!this.validateWhen() || !dataID) {
@@ -90679,7 +90689,8 @@ var List = class {
90679
90689
  data: insertData,
90680
90690
  variables,
90681
90691
  parent: this.recordID,
90682
- applyUpdates: [where === "first" ? "prepend" : "append"]
90692
+ applyUpdates: [where === "first" ? "prepend" : "append"],
90693
+ layer: layer?.id
90683
90694
  });
90684
90695
  }
90685
90696
  removeID(id2, variables = {}) {
@@ -90772,9 +90783,15 @@ var List = class {
90772
90783
  }
90773
90784
  return ok;
90774
90785
  }
90775
- toggleElement(selection, data2, variables = {}, where) {
90786
+ toggleElement({
90787
+ selection,
90788
+ data: data2,
90789
+ variables = {},
90790
+ layer,
90791
+ where
90792
+ }) {
90776
90793
  if (!this.remove(data2, variables)) {
90777
- this.addToList(selection, data2, variables, where);
90794
+ this.addToList(selection, data2, variables, where, layer);
90778
90795
  }
90779
90796
  }
90780
90797
  *[Symbol.iterator]() {
@@ -91770,6 +91787,9 @@ var CacheInternal = class {
91770
91787
  nullable,
91771
91788
  link: !!fieldSelection
91772
91789
  });
91790
+ if (value2 && typeof value2 === "object" && "__typename" in value2 && value2["__typename"]) {
91791
+ linkedType = value2["__typename"];
91792
+ }
91773
91793
  const currentSubscribers = this.subscriptions.get(parent, key);
91774
91794
  const specs = currentSubscribers.map((sub) => sub[0]);
91775
91795
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -91823,7 +91843,6 @@ var CacheInternal = class {
91823
91843
  "Encountered interface type without __typename in the payload"
91824
91844
  );
91825
91845
  }
91826
- linkedType = value2.__typename;
91827
91846
  }
91828
91847
  const embedded = this.idFields(linkedType)?.filter(
91829
91848
  (field2) => typeof value2[field2] === "undefined"
@@ -91979,7 +91998,8 @@ var CacheInternal = class {
91979
91998
  fieldSelection,
91980
91999
  target,
91981
92000
  variables,
91982
- operation.position || "last"
92001
+ operation.position || "last",
92002
+ layer
91983
92003
  );
91984
92004
  } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
91985
92005
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
@@ -91993,12 +92013,13 @@ var CacheInternal = class {
91993
92013
  }
91994
92014
  this.cache.delete(targetID);
91995
92015
  } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
91996
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
91997
- fieldSelection,
91998
- target,
92016
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
92017
+ selection: fieldSelection,
92018
+ data: target,
91999
92019
  variables,
92000
- operation.position || "last"
92001
- );
92020
+ where: operation.position || "last",
92021
+ layer
92022
+ });
92002
92023
  }
92003
92024
  }
92004
92025
  }
@@ -92027,7 +92048,7 @@ var CacheInternal = class {
92027
92048
  ])
92028
92049
  );
92029
92050
  }
92030
- let hasData = false;
92051
+ let hasData = !!selection.fragments;
92031
92052
  let partial = false;
92032
92053
  let cascadeNull = false;
92033
92054
  let stale = false;
@@ -92242,13 +92263,12 @@ var CacheInternal = class {
92242
92263
  const embedded = this.idFields(linkedType)?.filter(
92243
92264
  (field) => typeof entry[field] === "undefined"
92244
92265
  ).length > 0;
92245
- const typename = entryObj.__typename;
92246
92266
  let innerType = linkedType;
92247
- if (abstract) {
92248
- if (!typename) {
92249
- throw new Error("Encountered interface type without __typename in the payload");
92250
- }
92267
+ const typename = entryObj.__typename;
92268
+ if (typename) {
92251
92269
  innerType = typename;
92270
+ } else if (abstract) {
92271
+ throw new Error("Encountered interface type without __typename in the payload");
92252
92272
  }
92253
92273
  if (!embedded) {
92254
92274
  const id2 = this.id(innerType, entry);
@@ -155822,13 +155842,23 @@ var List2 = class {
155822
155842
  when(when) {
155823
155843
  return this.manager.lists.get(this.name).get(this.recordID).when(when);
155824
155844
  }
155825
- append(selection, data2, variables = {}) {
155826
- return this.addToList(selection, data2, variables, "last");
155845
+ append({
155846
+ selection,
155847
+ data: data2,
155848
+ variables = {},
155849
+ layer
155850
+ }) {
155851
+ return this.addToList(selection, data2, variables, "last", layer);
155827
155852
  }
155828
- prepend(selection, data2, variables = {}) {
155829
- return this.addToList(selection, data2, variables, "first");
155853
+ prepend({
155854
+ selection,
155855
+ data: data2,
155856
+ variables = {},
155857
+ layer
155858
+ }) {
155859
+ return this.addToList(selection, data2, variables, "first", layer);
155830
155860
  }
155831
- addToList(selection, data2, variables = {}, where) {
155861
+ addToList(selection, data2, variables = {}, where, layer) {
155832
155862
  const listType = this.listType(data2);
155833
155863
  const dataID = this.cache._internal_unstable.id(listType, data2);
155834
155864
  if (!this.validateWhen() || !dataID) {
@@ -155906,7 +155936,8 @@ var List2 = class {
155906
155936
  data: insertData,
155907
155937
  variables,
155908
155938
  parent: this.recordID,
155909
- applyUpdates: [where === "first" ? "prepend" : "append"]
155939
+ applyUpdates: [where === "first" ? "prepend" : "append"],
155940
+ layer: layer?.id
155910
155941
  });
155911
155942
  }
155912
155943
  removeID(id2, variables = {}) {
@@ -155999,9 +156030,15 @@ var List2 = class {
155999
156030
  }
156000
156031
  return ok;
156001
156032
  }
156002
- toggleElement(selection, data2, variables = {}, where) {
156033
+ toggleElement({
156034
+ selection,
156035
+ data: data2,
156036
+ variables = {},
156037
+ layer,
156038
+ where
156039
+ }) {
156003
156040
  if (!this.remove(data2, variables)) {
156004
- this.addToList(selection, data2, variables, where);
156041
+ this.addToList(selection, data2, variables, where, layer);
156005
156042
  }
156006
156043
  }
156007
156044
  *[Symbol.iterator]() {
@@ -156997,6 +157034,9 @@ var CacheInternal2 = class {
156997
157034
  nullable,
156998
157035
  link: !!fieldSelection
156999
157036
  });
157037
+ if (value2 && typeof value2 === "object" && "__typename" in value2 && value2["__typename"]) {
157038
+ linkedType = value2["__typename"];
157039
+ }
157000
157040
  const currentSubscribers = this.subscriptions.get(parent, key);
157001
157041
  const specs = currentSubscribers.map((sub) => sub[0]);
157002
157042
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
@@ -157050,7 +157090,6 @@ var CacheInternal2 = class {
157050
157090
  "Encountered interface type without __typename in the payload"
157051
157091
  );
157052
157092
  }
157053
- linkedType = value2.__typename;
157054
157093
  }
157055
157094
  const embedded = this.idFields(linkedType)?.filter(
157056
157095
  (field2) => typeof value2[field2] === "undefined"
@@ -157206,7 +157245,8 @@ var CacheInternal2 = class {
157206
157245
  fieldSelection,
157207
157246
  target,
157208
157247
  variables,
157209
- operation.position || "last"
157248
+ operation.position || "last",
157249
+ layer
157210
157250
  );
157211
157251
  } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
157212
157252
  this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
@@ -157220,12 +157260,13 @@ var CacheInternal2 = class {
157220
157260
  }
157221
157261
  this.cache.delete(targetID);
157222
157262
  } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
157223
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
157224
- fieldSelection,
157225
- target,
157263
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
157264
+ selection: fieldSelection,
157265
+ data: target,
157226
157266
  variables,
157227
- operation.position || "last"
157228
- );
157267
+ where: operation.position || "last",
157268
+ layer
157269
+ });
157229
157270
  }
157230
157271
  }
157231
157272
  }
@@ -157254,7 +157295,7 @@ var CacheInternal2 = class {
157254
157295
  ])
157255
157296
  );
157256
157297
  }
157257
- let hasData = false;
157298
+ let hasData = !!selection.fragments;
157258
157299
  let partial = false;
157259
157300
  let cascadeNull = false;
157260
157301
  let stale = false;
@@ -157469,13 +157510,12 @@ var CacheInternal2 = class {
157469
157510
  const embedded = this.idFields(linkedType)?.filter(
157470
157511
  (field) => typeof entry[field] === "undefined"
157471
157512
  ).length > 0;
157472
- const typename = entryObj.__typename;
157473
157513
  let innerType = linkedType;
157474
- if (abstract) {
157475
- if (!typename) {
157476
- throw new Error("Encountered interface type without __typename in the payload");
157477
- }
157514
+ const typename = entryObj.__typename;
157515
+ if (typename) {
157478
157516
  innerType = typename;
157517
+ } else if (abstract) {
157518
+ throw new Error("Encountered interface type without __typename in the payload");
157479
157519
  }
157480
157520
  if (!embedded) {
157481
157521
  const id2 = this.id(innerType, entry);