houdini-svelte 1.1.2 → 1.1.4-react.0

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.
Files changed (46) hide show
  1. package/build/plugin-cjs/index.js +261 -225
  2. package/build/plugin-esm/index.js +261 -225
  3. package/build/preprocess-cjs/index.js +272 -225
  4. package/build/preprocess-esm/index.js +272 -225
  5. package/build/runtime/stores/index.d.ts +1 -1
  6. package/build/runtime/stores/pagination/fragment.d.ts +4 -7
  7. package/build/runtime/stores/pagination/query.d.ts +3 -4
  8. package/build/runtime/stores/query.d.ts +2 -54
  9. package/build/runtime/types.d.ts +40 -28
  10. package/build/runtime-cjs/stores/index.d.ts +1 -1
  11. package/build/runtime-cjs/stores/pagination/fragment.d.ts +4 -7
  12. package/build/runtime-cjs/stores/pagination/fragment.js +6 -9
  13. package/build/runtime-cjs/stores/pagination/query.d.ts +3 -4
  14. package/build/runtime-cjs/stores/pagination/query.js +28 -22
  15. package/build/runtime-cjs/stores/query.d.ts +2 -54
  16. package/build/runtime-cjs/types.d.ts +40 -28
  17. package/build/runtime-esm/stores/index.d.ts +1 -1
  18. package/build/runtime-esm/stores/pagination/fragment.d.ts +4 -7
  19. package/build/runtime-esm/stores/pagination/fragment.js +4 -7
  20. package/build/runtime-esm/stores/pagination/query.d.ts +3 -4
  21. package/build/runtime-esm/stores/pagination/query.js +23 -17
  22. package/build/runtime-esm/stores/query.d.ts +2 -54
  23. package/build/runtime-esm/types.d.ts +40 -28
  24. package/build/test-cjs/index.js +601 -491
  25. package/build/test-esm/index.js +601 -491
  26. package/package.json +2 -2
  27. package/build/runtime/stores/pagination/cursor.d.ts +0 -13
  28. package/build/runtime/stores/pagination/fetch.d.ts +0 -3
  29. package/build/runtime/stores/pagination/offset.d.ts +0 -20
  30. package/build/runtime/stores/pagination/pageInfo.d.ts +0 -13
  31. package/build/runtime-cjs/stores/pagination/cursor.d.ts +0 -13
  32. package/build/runtime-cjs/stores/pagination/cursor.js +0 -191
  33. package/build/runtime-cjs/stores/pagination/fetch.d.ts +0 -3
  34. package/build/runtime-cjs/stores/pagination/fetch.js +0 -16
  35. package/build/runtime-cjs/stores/pagination/offset.d.ts +0 -20
  36. package/build/runtime-cjs/stores/pagination/offset.js +0 -89
  37. package/build/runtime-cjs/stores/pagination/pageInfo.d.ts +0 -13
  38. package/build/runtime-cjs/stores/pagination/pageInfo.js +0 -79
  39. package/build/runtime-esm/stores/pagination/cursor.d.ts +0 -13
  40. package/build/runtime-esm/stores/pagination/cursor.js +0 -167
  41. package/build/runtime-esm/stores/pagination/fetch.d.ts +0 -3
  42. package/build/runtime-esm/stores/pagination/fetch.js +0 -0
  43. package/build/runtime-esm/stores/pagination/offset.d.ts +0 -20
  44. package/build/runtime-esm/stores/pagination/offset.js +0 -65
  45. package/build/runtime-esm/stores/pagination/pageInfo.d.ts +0 -13
  46. package/build/runtime-esm/stores/pagination/pageInfo.js +0 -52
@@ -33419,7 +33419,7 @@ var require_visitor = __commonJS2({
33419
33419
  Object.defineProperty(exports, "__esModule", {
33420
33420
  value: true
33421
33421
  });
33422
- exports.visit = visit2;
33422
+ exports.visit = visit3;
33423
33423
  exports.visitInParallel = visitInParallel;
33424
33424
  exports.getVisitFn = getVisitFn;
33425
33425
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -33482,7 +33482,7 @@ var require_visitor = __commonJS2({
33482
33482
  exports.QueryDocumentKeys = QueryDocumentKeys;
33483
33483
  var BREAK = Object.freeze({});
33484
33484
  exports.BREAK = BREAK;
33485
- function visit2(root, visitor) {
33485
+ function visit3(root, visitor) {
33486
33486
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
33487
33487
  var stack = void 0;
33488
33488
  var inArray = Array.isArray(root);
@@ -72708,6 +72708,107 @@ var require_lib3 = __commonJS2({
72708
72708
  exports.tokTypes = tokTypes;
72709
72709
  }
72710
72710
  });
72711
+ var require_cjs = __commonJS2({
72712
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
72713
+ "use strict";
72714
+ var isMergeableObject = function isMergeableObject2(value2) {
72715
+ return isNonNullObject(value2) && !isSpecial(value2);
72716
+ };
72717
+ function isNonNullObject(value2) {
72718
+ return !!value2 && typeof value2 === "object";
72719
+ }
72720
+ function isSpecial(value2) {
72721
+ var stringValue = Object.prototype.toString.call(value2);
72722
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
72723
+ }
72724
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
72725
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
72726
+ function isReactElement(value2) {
72727
+ return value2.$$typeof === REACT_ELEMENT_TYPE;
72728
+ }
72729
+ function emptyTarget(val) {
72730
+ return Array.isArray(val) ? [] : {};
72731
+ }
72732
+ function cloneUnlessOtherwiseSpecified(value2, options) {
72733
+ return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
72734
+ }
72735
+ function defaultArrayMerge(target, source, options) {
72736
+ return target.concat(source).map(function(element) {
72737
+ return cloneUnlessOtherwiseSpecified(element, options);
72738
+ });
72739
+ }
72740
+ function getMergeFunction(key, options) {
72741
+ if (!options.customMerge) {
72742
+ return deepmerge;
72743
+ }
72744
+ var customMerge = options.customMerge(key);
72745
+ return typeof customMerge === "function" ? customMerge : deepmerge;
72746
+ }
72747
+ function getEnumerableOwnPropertySymbols(target) {
72748
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
72749
+ return target.propertyIsEnumerable(symbol);
72750
+ }) : [];
72751
+ }
72752
+ function getKeys(target) {
72753
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
72754
+ }
72755
+ function propertyIsOnObject(object, property) {
72756
+ try {
72757
+ return property in object;
72758
+ } catch (_) {
72759
+ return false;
72760
+ }
72761
+ }
72762
+ function propertyIsUnsafe(target, key) {
72763
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
72764
+ }
72765
+ function mergeObject(target, source, options) {
72766
+ var destination = {};
72767
+ if (options.isMergeableObject(target)) {
72768
+ getKeys(target).forEach(function(key) {
72769
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
72770
+ });
72771
+ }
72772
+ getKeys(source).forEach(function(key) {
72773
+ if (propertyIsUnsafe(target, key)) {
72774
+ return;
72775
+ }
72776
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
72777
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
72778
+ } else {
72779
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
72780
+ }
72781
+ });
72782
+ return destination;
72783
+ }
72784
+ function deepmerge(target, source, options) {
72785
+ options = options || {};
72786
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
72787
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
72788
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
72789
+ var sourceIsArray = Array.isArray(source);
72790
+ var targetIsArray = Array.isArray(target);
72791
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
72792
+ if (!sourceAndTargetTypesMatch) {
72793
+ return cloneUnlessOtherwiseSpecified(source, options);
72794
+ } else if (sourceIsArray) {
72795
+ return options.arrayMerge(target, source, options);
72796
+ } else {
72797
+ return mergeObject(target, source, options);
72798
+ }
72799
+ }
72800
+ deepmerge.all = function deepmergeAll(array, options) {
72801
+ if (!Array.isArray(array)) {
72802
+ throw new Error("first argument should be an array");
72803
+ }
72804
+ return array.reduce(function(prev, next) {
72805
+ return deepmerge(prev, next, options);
72806
+ }, {});
72807
+ };
72808
+ var deepmerge_1 = deepmerge;
72809
+ module.exports = deepmerge_1;
72810
+ }
72811
+ });
72711
72812
  var require_tslib = __commonJS2({
72712
72813
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module) {
72713
72814
  var __extends;
@@ -74964,7 +75065,7 @@ var require_path_visitor = __commonJS2({
74964
75065
  }
74965
75066
  return target;
74966
75067
  }
74967
- PathVisitor.visit = function visit2(node2, methods) {
75068
+ PathVisitor.visit = function visit3(node2, methods) {
74968
75069
  return PathVisitor.fromMethodsObject(methods).visit(node2);
74969
75070
  };
74970
75071
  var PVp = PathVisitor.prototype;
@@ -75155,7 +75256,7 @@ var require_path_visitor = __commonJS2({
75155
75256
  this.needToCallTraverse = false;
75156
75257
  return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
75157
75258
  };
75158
- sharedContextProtoMethods.visit = function visit2(path22, newVisitor) {
75259
+ sharedContextProtoMethods.visit = function visit3(path22, newVisitor) {
75159
75260
  if (!(this instanceof this.Context)) {
75160
75261
  throw new Error("");
75161
75262
  }
@@ -76498,7 +76599,7 @@ var require_main = __commonJS2({
76498
76599
  var someField = _a.someField;
76499
76600
  var Type = _a.Type;
76500
76601
  var use = _a.use;
76501
- var visit2 = _a.visit;
76602
+ var visit3 = _a.visit;
76502
76603
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
76503
76604
  exports.builders = builders;
76504
76605
  exports.builtInTypes = builtInTypes;
@@ -76515,7 +76616,7 @@ var require_main = __commonJS2({
76515
76616
  exports.someField = someField;
76516
76617
  exports.Type = Type;
76517
76618
  exports.use = use;
76518
- exports.visit = visit2;
76619
+ exports.visit = visit3;
76519
76620
  Object.assign(namedTypes_1.namedTypes, n);
76520
76621
  }
76521
76622
  });
@@ -88930,107 +89031,6 @@ var require_main2 = __commonJS2({
88930
89031
  }
88931
89032
  }
88932
89033
  });
88933
- var require_cjs = __commonJS2({
88934
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
88935
- "use strict";
88936
- var isMergeableObject = function isMergeableObject2(value2) {
88937
- return isNonNullObject(value2) && !isSpecial(value2);
88938
- };
88939
- function isNonNullObject(value2) {
88940
- return !!value2 && typeof value2 === "object";
88941
- }
88942
- function isSpecial(value2) {
88943
- var stringValue = Object.prototype.toString.call(value2);
88944
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
88945
- }
88946
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
88947
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
88948
- function isReactElement(value2) {
88949
- return value2.$$typeof === REACT_ELEMENT_TYPE;
88950
- }
88951
- function emptyTarget(val) {
88952
- return Array.isArray(val) ? [] : {};
88953
- }
88954
- function cloneUnlessOtherwiseSpecified(value2, options) {
88955
- return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
88956
- }
88957
- function defaultArrayMerge(target, source, options) {
88958
- return target.concat(source).map(function(element) {
88959
- return cloneUnlessOtherwiseSpecified(element, options);
88960
- });
88961
- }
88962
- function getMergeFunction(key, options) {
88963
- if (!options.customMerge) {
88964
- return deepmerge;
88965
- }
88966
- var customMerge = options.customMerge(key);
88967
- return typeof customMerge === "function" ? customMerge : deepmerge;
88968
- }
88969
- function getEnumerableOwnPropertySymbols(target) {
88970
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
88971
- return target.propertyIsEnumerable(symbol);
88972
- }) : [];
88973
- }
88974
- function getKeys(target) {
88975
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
88976
- }
88977
- function propertyIsOnObject(object, property) {
88978
- try {
88979
- return property in object;
88980
- } catch (_) {
88981
- return false;
88982
- }
88983
- }
88984
- function propertyIsUnsafe(target, key) {
88985
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
88986
- }
88987
- function mergeObject(target, source, options) {
88988
- var destination = {};
88989
- if (options.isMergeableObject(target)) {
88990
- getKeys(target).forEach(function(key) {
88991
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
88992
- });
88993
- }
88994
- getKeys(source).forEach(function(key) {
88995
- if (propertyIsUnsafe(target, key)) {
88996
- return;
88997
- }
88998
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
88999
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
89000
- } else {
89001
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
89002
- }
89003
- });
89004
- return destination;
89005
- }
89006
- function deepmerge(target, source, options) {
89007
- options = options || {};
89008
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
89009
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
89010
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
89011
- var sourceIsArray = Array.isArray(source);
89012
- var targetIsArray = Array.isArray(target);
89013
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
89014
- if (!sourceAndTargetTypesMatch) {
89015
- return cloneUnlessOtherwiseSpecified(source, options);
89016
- } else if (sourceIsArray) {
89017
- return options.arrayMerge(target, source, options);
89018
- } else {
89019
- return mergeObject(target, source, options);
89020
- }
89021
- }
89022
- deepmerge.all = function deepmergeAll(array, options) {
89023
- if (!Array.isArray(array)) {
89024
- throw new Error("first argument should be an array");
89025
- }
89026
- return array.reduce(function(prev, next) {
89027
- return deepmerge(prev, next, options);
89028
- }, {});
89029
- };
89030
- var deepmerge_1 = deepmerge;
89031
- module.exports = deepmerge_1;
89032
- }
89033
- });
89034
89034
  async function runPipeline(config5, pipeline22, target) {
89035
89035
  for (const transform of pipeline22) {
89036
89036
  await transform?.(config5, target);
@@ -92390,10 +92390,11 @@ var query = documentPlugin(ArtifactKind.Query, function() {
92390
92390
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
92391
92391
  }
92392
92392
  lastVariables = { ...marshalVariables2(ctx) };
92393
+ const variables = lastVariables;
92393
92394
  subscriptionSpec = {
92394
92395
  rootType: ctx.artifact.rootType,
92395
92396
  selection: ctx.artifact.selection,
92396
- variables: () => lastVariables,
92397
+ variables: () => variables,
92397
92398
  set: (newValue) => {
92398
92399
  resolve22(ctx, {
92399
92400
  data: newValue,
@@ -92420,12 +92421,17 @@ var query = documentPlugin(ArtifactKind.Query, function() {
92420
92421
  });
92421
92422
  var fragment = documentPlugin(ArtifactKind.Fragment, function() {
92422
92423
  let subscriptionSpec = null;
92424
+ let lastReference = null;
92423
92425
  return {
92424
92426
  start(ctx, { next, resolve: resolve22, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
92425
92427
  if (!ctx.stuff.parentID) {
92426
92428
  return next(ctx);
92427
92429
  }
92428
- if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
92430
+ const currentReference = {
92431
+ parent: ctx.stuff.parentID,
92432
+ variables: marshalVariables2(ctx)
92433
+ };
92434
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
92429
92435
  if (subscriptionSpec) {
92430
92436
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
92431
92437
  }
@@ -92448,6 +92454,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
92448
92454
  }
92449
92455
  };
92450
92456
  cache_default.subscribe(subscriptionSpec, variables);
92457
+ lastReference = currentReference;
92451
92458
  }
92452
92459
  next(ctx);
92453
92460
  },
@@ -92566,13 +92573,36 @@ var TypeWrapper = /* @__PURE__ */ ((TypeWrapper22) => {
92566
92573
  return TypeWrapper22;
92567
92574
  })(TypeWrapper || {});
92568
92575
  var import_parser = __toESM2(require_lib3(), 1);
92569
- async function parseJS(str) {
92576
+ var import_deepmerge = __toESM2(require_cjs(), 1);
92577
+ function deepMerge(filepath, ...targets) {
92578
+ try {
92579
+ if (targets.length === 1) {
92580
+ return targets[0];
92581
+ } else if (targets.length === 2) {
92582
+ return (0, import_deepmerge.default)(targets[0], targets[1], {
92583
+ arrayMerge: (source, update) => [...new Set(source.concat(update))]
92584
+ });
92585
+ }
92586
+ return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
92587
+ } catch (e22) {
92588
+ throw new HoudiniError({
92589
+ filepath,
92590
+ message: "could not merge: " + JSON.stringify(targets, null, 4),
92591
+ description: e22.message
92592
+ });
92593
+ }
92594
+ }
92595
+ async function parseJS(str, config5) {
92596
+ const defaultConfig = {
92597
+ plugins: ["typescript"],
92598
+ sourceType: "module"
92599
+ };
92570
92600
  return {
92571
92601
  start: 0,
92572
- script: (0, import_parser.parse)(str || "", {
92573
- plugins: ["typescript"],
92574
- sourceType: "module"
92575
- }).program,
92602
+ script: (0, import_parser.parse)(
92603
+ str || "",
92604
+ config5 ? deepMerge("", defaultConfig, config5) : defaultConfig
92605
+ ).program,
92576
92606
  end: str.length
92577
92607
  };
92578
92608
  }
@@ -92617,7 +92647,6 @@ async function cleanupFiles(pathFolder, listOfObj) {
92617
92647
  );
92618
92648
  return allFilesNotInList;
92619
92649
  }
92620
- var import_deepmerge = __toESM2(require_cjs(), 1);
92621
92650
  async function detectFromPackageJSON(cwd) {
92622
92651
  try {
92623
92652
  const packageJSONFile = await fs_exports.readFile(path_exports.join(cwd, "package.json"));
@@ -95186,7 +95215,7 @@ var require_visitor2 = __commonJS3({
95186
95215
  Object.defineProperty(exports, "__esModule", {
95187
95216
  value: true
95188
95217
  });
95189
- exports.visit = visit12;
95218
+ exports.visit = visit13;
95190
95219
  exports.visitInParallel = visitInParallel;
95191
95220
  exports.getVisitFn = getVisitFn;
95192
95221
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -95249,7 +95278,7 @@ var require_visitor2 = __commonJS3({
95249
95278
  exports.QueryDocumentKeys = QueryDocumentKeys;
95250
95279
  var BREAK = Object.freeze({});
95251
95280
  exports.BREAK = BREAK;
95252
- function visit12(root, visitor) {
95281
+ function visit13(root, visitor) {
95253
95282
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
95254
95283
  var stack = void 0;
95255
95284
  var inArray = Array.isArray(root);
@@ -130114,6 +130143,107 @@ var require_lib32 = __commonJS3({
130114
130143
  exports.tokTypes = tokTypes;
130115
130144
  }
130116
130145
  });
130146
+ var require_cjs2 = __commonJS3({
130147
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
130148
+ "use strict";
130149
+ var isMergeableObject = function isMergeableObject2(value2) {
130150
+ return isNonNullObject(value2) && !isSpecial(value2);
130151
+ };
130152
+ function isNonNullObject(value2) {
130153
+ return !!value2 && typeof value2 === "object";
130154
+ }
130155
+ function isSpecial(value2) {
130156
+ var stringValue = Object.prototype.toString.call(value2);
130157
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
130158
+ }
130159
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
130160
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
130161
+ function isReactElement(value2) {
130162
+ return value2.$$typeof === REACT_ELEMENT_TYPE;
130163
+ }
130164
+ function emptyTarget(val) {
130165
+ return Array.isArray(val) ? [] : {};
130166
+ }
130167
+ function cloneUnlessOtherwiseSpecified(value2, options) {
130168
+ return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
130169
+ }
130170
+ function defaultArrayMerge(target, source, options) {
130171
+ return target.concat(source).map(function(element) {
130172
+ return cloneUnlessOtherwiseSpecified(element, options);
130173
+ });
130174
+ }
130175
+ function getMergeFunction(key, options) {
130176
+ if (!options.customMerge) {
130177
+ return deepmerge;
130178
+ }
130179
+ var customMerge = options.customMerge(key);
130180
+ return typeof customMerge === "function" ? customMerge : deepmerge;
130181
+ }
130182
+ function getEnumerableOwnPropertySymbols(target) {
130183
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
130184
+ return target.propertyIsEnumerable(symbol);
130185
+ }) : [];
130186
+ }
130187
+ function getKeys(target) {
130188
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
130189
+ }
130190
+ function propertyIsOnObject(object, property) {
130191
+ try {
130192
+ return property in object;
130193
+ } catch (_) {
130194
+ return false;
130195
+ }
130196
+ }
130197
+ function propertyIsUnsafe(target, key) {
130198
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
130199
+ }
130200
+ function mergeObject(target, source, options) {
130201
+ var destination = {};
130202
+ if (options.isMergeableObject(target)) {
130203
+ getKeys(target).forEach(function(key) {
130204
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
130205
+ });
130206
+ }
130207
+ getKeys(source).forEach(function(key) {
130208
+ if (propertyIsUnsafe(target, key)) {
130209
+ return;
130210
+ }
130211
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
130212
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
130213
+ } else {
130214
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
130215
+ }
130216
+ });
130217
+ return destination;
130218
+ }
130219
+ function deepmerge(target, source, options) {
130220
+ options = options || {};
130221
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
130222
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
130223
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
130224
+ var sourceIsArray = Array.isArray(source);
130225
+ var targetIsArray = Array.isArray(target);
130226
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
130227
+ if (!sourceAndTargetTypesMatch) {
130228
+ return cloneUnlessOtherwiseSpecified(source, options);
130229
+ } else if (sourceIsArray) {
130230
+ return options.arrayMerge(target, source, options);
130231
+ } else {
130232
+ return mergeObject(target, source, options);
130233
+ }
130234
+ }
130235
+ deepmerge.all = function deepmergeAll(array, options) {
130236
+ if (!Array.isArray(array)) {
130237
+ throw new Error("first argument should be an array");
130238
+ }
130239
+ return array.reduce(function(prev, next) {
130240
+ return deepmerge(prev, next, options);
130241
+ }, {});
130242
+ };
130243
+ var deepmerge_1 = deepmerge;
130244
+ module.exports = deepmerge_1;
130245
+ }
130246
+ });
130117
130247
  var require_tslib2 = __commonJS3({
130118
130248
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module) {
130119
130249
  var __extends;
@@ -132370,7 +132500,7 @@ var require_path_visitor2 = __commonJS3({
132370
132500
  }
132371
132501
  return target;
132372
132502
  }
132373
- PathVisitor.visit = function visit12(node2, methods) {
132503
+ PathVisitor.visit = function visit13(node2, methods) {
132374
132504
  return PathVisitor.fromMethodsObject(methods).visit(node2);
132375
132505
  };
132376
132506
  var PVp = PathVisitor.prototype;
@@ -132561,7 +132691,7 @@ var require_path_visitor2 = __commonJS3({
132561
132691
  this.needToCallTraverse = false;
132562
132692
  return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
132563
132693
  };
132564
- sharedContextProtoMethods.visit = function visit12(path22, newVisitor) {
132694
+ sharedContextProtoMethods.visit = function visit13(path22, newVisitor) {
132565
132695
  if (!(this instanceof this.Context)) {
132566
132696
  throw new Error("");
132567
132697
  }
@@ -133904,7 +134034,7 @@ var require_main3 = __commonJS3({
133904
134034
  var someField = _a.someField;
133905
134035
  var Type = _a.Type;
133906
134036
  var use = _a.use;
133907
- var visit12 = _a.visit;
134037
+ var visit13 = _a.visit;
133908
134038
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
133909
134039
  exports.builders = builders;
133910
134040
  exports.builtInTypes = builtInTypes;
@@ -133921,7 +134051,7 @@ var require_main3 = __commonJS3({
133921
134051
  exports.someField = someField;
133922
134052
  exports.Type = Type;
133923
134053
  exports.use = use;
133924
- exports.visit = visit12;
134054
+ exports.visit = visit13;
133925
134055
  Object.assign(namedTypes_1.namedTypes, n);
133926
134056
  }
133927
134057
  });
@@ -146336,107 +146466,6 @@ var require_main22 = __commonJS3({
146336
146466
  }
146337
146467
  }
146338
146468
  });
146339
- var require_cjs2 = __commonJS3({
146340
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
146341
- "use strict";
146342
- var isMergeableObject = function isMergeableObject2(value2) {
146343
- return isNonNullObject(value2) && !isSpecial(value2);
146344
- };
146345
- function isNonNullObject(value2) {
146346
- return !!value2 && typeof value2 === "object";
146347
- }
146348
- function isSpecial(value2) {
146349
- var stringValue = Object.prototype.toString.call(value2);
146350
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
146351
- }
146352
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
146353
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
146354
- function isReactElement(value2) {
146355
- return value2.$$typeof === REACT_ELEMENT_TYPE;
146356
- }
146357
- function emptyTarget(val) {
146358
- return Array.isArray(val) ? [] : {};
146359
- }
146360
- function cloneUnlessOtherwiseSpecified(value2, options) {
146361
- return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
146362
- }
146363
- function defaultArrayMerge(target, source, options) {
146364
- return target.concat(source).map(function(element) {
146365
- return cloneUnlessOtherwiseSpecified(element, options);
146366
- });
146367
- }
146368
- function getMergeFunction(key, options) {
146369
- if (!options.customMerge) {
146370
- return deepmerge;
146371
- }
146372
- var customMerge = options.customMerge(key);
146373
- return typeof customMerge === "function" ? customMerge : deepmerge;
146374
- }
146375
- function getEnumerableOwnPropertySymbols(target) {
146376
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
146377
- return target.propertyIsEnumerable(symbol);
146378
- }) : [];
146379
- }
146380
- function getKeys(target) {
146381
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
146382
- }
146383
- function propertyIsOnObject(object, property) {
146384
- try {
146385
- return property in object;
146386
- } catch (_) {
146387
- return false;
146388
- }
146389
- }
146390
- function propertyIsUnsafe(target, key) {
146391
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
146392
- }
146393
- function mergeObject(target, source, options) {
146394
- var destination = {};
146395
- if (options.isMergeableObject(target)) {
146396
- getKeys(target).forEach(function(key) {
146397
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
146398
- });
146399
- }
146400
- getKeys(source).forEach(function(key) {
146401
- if (propertyIsUnsafe(target, key)) {
146402
- return;
146403
- }
146404
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
146405
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
146406
- } else {
146407
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
146408
- }
146409
- });
146410
- return destination;
146411
- }
146412
- function deepmerge(target, source, options) {
146413
- options = options || {};
146414
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
146415
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
146416
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
146417
- var sourceIsArray = Array.isArray(source);
146418
- var targetIsArray = Array.isArray(target);
146419
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
146420
- if (!sourceAndTargetTypesMatch) {
146421
- return cloneUnlessOtherwiseSpecified(source, options);
146422
- } else if (sourceIsArray) {
146423
- return options.arrayMerge(target, source, options);
146424
- } else {
146425
- return mergeObject(target, source, options);
146426
- }
146427
- }
146428
- deepmerge.all = function deepmergeAll(array, options) {
146429
- if (!Array.isArray(array)) {
146430
- throw new Error("first argument should be an array");
146431
- }
146432
- return array.reduce(function(prev, next) {
146433
- return deepmerge(prev, next, options);
146434
- }, {});
146435
- };
146436
- var deepmerge_1 = deepmerge;
146437
- module.exports = deepmerge_1;
146438
- }
146439
- });
146440
146469
  var graphql26 = __toESM3(require_graphql22(), 1);
146441
146470
  async function runPipeline2(config22, pipeline4, target) {
146442
146471
  for (const transform of pipeline4) {
@@ -148886,10 +148915,11 @@ var query2 = documentPlugin2(ArtifactKind2.Query, function() {
148886
148915
  cache_default2.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
148887
148916
  }
148888
148917
  lastVariables = { ...marshalVariables(ctx) };
148918
+ const variables = lastVariables;
148889
148919
  subscriptionSpec = {
148890
148920
  rootType: ctx.artifact.rootType,
148891
148921
  selection: ctx.artifact.selection,
148892
- variables: () => lastVariables,
148922
+ variables: () => variables,
148893
148923
  set: (newValue) => {
148894
148924
  resolve22(ctx, {
148895
148925
  data: newValue,
@@ -148916,12 +148946,17 @@ var query2 = documentPlugin2(ArtifactKind2.Query, function() {
148916
148946
  });
148917
148947
  var fragment2 = documentPlugin2(ArtifactKind2.Fragment, function() {
148918
148948
  let subscriptionSpec = null;
148949
+ let lastReference = null;
148919
148950
  return {
148920
148951
  start(ctx, { next, resolve: resolve22, variablesChanged, marshalVariables }) {
148921
148952
  if (!ctx.stuff.parentID) {
148922
148953
  return next(ctx);
148923
148954
  }
148924
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
148955
+ const currentReference = {
148956
+ parent: ctx.stuff.parentID,
148957
+ variables: marshalVariables(ctx)
148958
+ };
148959
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals2(lastReference, currentReference) || variablesChanged(ctx))) {
148925
148960
  if (subscriptionSpec) {
148926
148961
  cache_default2.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
148927
148962
  }
@@ -148944,6 +148979,7 @@ var fragment2 = documentPlugin2(ArtifactKind2.Fragment, function() {
148944
148979
  }
148945
148980
  };
148946
148981
  cache_default2.subscribe(subscriptionSpec, variables);
148982
+ lastReference = currentReference;
148947
148983
  }
148948
148984
  next(ctx);
148949
148985
  },
@@ -149156,13 +149192,36 @@ var TypeWrapper2 = /* @__PURE__ */ ((TypeWrapper22) => {
149156
149192
  return TypeWrapper22;
149157
149193
  })(TypeWrapper2 || {});
149158
149194
  var import_parser2 = __toESM3(require_lib32(), 1);
149159
- async function parseJS2(str) {
149195
+ var import_deepmerge2 = __toESM3(require_cjs2(), 1);
149196
+ function deepMerge2(filepath, ...targets) {
149197
+ try {
149198
+ if (targets.length === 1) {
149199
+ return targets[0];
149200
+ } else if (targets.length === 2) {
149201
+ return (0, import_deepmerge2.default)(targets[0], targets[1], {
149202
+ arrayMerge: (source, update) => [...new Set(source.concat(update))]
149203
+ });
149204
+ }
149205
+ return deepMerge2(filepath, targets[0], deepMerge2(filepath, ...targets.slice(1)));
149206
+ } catch (e3) {
149207
+ throw new HoudiniError2({
149208
+ filepath,
149209
+ message: "could not merge: " + JSON.stringify(targets, null, 4),
149210
+ description: e3.message
149211
+ });
149212
+ }
149213
+ }
149214
+ async function parseJS2(str, config22) {
149215
+ const defaultConfig = {
149216
+ plugins: ["typescript"],
149217
+ sourceType: "module"
149218
+ };
149160
149219
  return {
149161
149220
  start: 0,
149162
- script: (0, import_parser2.parse)(str || "", {
149163
- plugins: ["typescript"],
149164
- sourceType: "module"
149165
- }).program,
149221
+ script: (0, import_parser2.parse)(
149222
+ str || "",
149223
+ config22 ? deepMerge2("", defaultConfig, config22) : defaultConfig
149224
+ ).program,
149166
149225
  end: str.length
149167
149226
  };
149168
149227
  }
@@ -149207,25 +149266,6 @@ async function cleanupFiles2(pathFolder, listOfObj) {
149207
149266
  );
149208
149267
  return allFilesNotInList;
149209
149268
  }
149210
- var import_deepmerge2 = __toESM3(require_cjs2(), 1);
149211
- function deepMerge(filepath, ...targets) {
149212
- try {
149213
- if (targets.length === 1) {
149214
- return targets[0];
149215
- } else if (targets.length === 2) {
149216
- return (0, import_deepmerge2.default)(targets[0], targets[1], {
149217
- arrayMerge: (source, update) => [...new Set(source.concat(update))]
149218
- });
149219
- }
149220
- return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
149221
- } catch (e3) {
149222
- throw new HoudiniError2({
149223
- filepath,
149224
- message: "could not merge: " + targets,
149225
- description: e3.message
149226
- });
149227
- }
149228
- }
149229
149269
  var graphql32 = __toESM3(require_graphql22(), 1);
149230
149270
  var graphql13 = __toESM3(require_graphql22(), 1);
149231
149271
  var recast5 = __toESM3(require_main22(), 1);
@@ -151130,7 +151170,7 @@ function prepareSelection({
151130
151170
  for (const field of selections) {
151131
151171
  if (field.kind === "InlineFragment") {
151132
151172
  if (!field.typeCondition || field.typeCondition.name.value === rootType) {
151133
- object.fields = deepMerge(
151173
+ object.fields = deepMerge2(
151134
151174
  filepath,
151135
151175
  object.fields || {},
151136
151176
  prepareSelection({
@@ -151291,7 +151331,7 @@ function prepareSelection({
151291
151331
  fieldObj.abstract = true;
151292
151332
  }
151293
151333
  if (object.fields?.[attributeName]) {
151294
- fieldObj = deepMerge(filepath, object.fields[attributeName], fieldObj);
151334
+ fieldObj = deepMerge2(filepath, object.fields[attributeName], fieldObj);
151295
151335
  }
151296
151336
  object.fields = {
151297
151337
  ...object.fields,
@@ -151318,7 +151358,7 @@ function mergeSelection({
151318
151358
  let overlap = false;
151319
151359
  for (const possible of possibles) {
151320
151360
  if (object.abstractFields.fields[typeName]) {
151321
- object.abstractFields.fields[typeName] = deepMerge(
151361
+ object.abstractFields.fields[typeName] = deepMerge2(
151322
151362
  filepath,
151323
151363
  object.abstractFields.fields[typeName] ?? {},
151324
151364
  object.abstractFields.fields[possible] ?? {}
@@ -151332,7 +151372,7 @@ function mergeSelection({
151332
151372
  }
151333
151373
  for (const [type, options] of Object.entries(typeMap)) {
151334
151374
  if (options.length > 1) {
151335
- object.abstractFields.fields[type] = deepMerge(
151375
+ object.abstractFields.fields[type] = deepMerge2(
151336
151376
  filepath,
151337
151377
  ...options.map((opt) => object.abstractFields.fields[opt] || {})
151338
151378
  );
@@ -151340,7 +151380,7 @@ function mergeSelection({
151340
151380
  }
151341
151381
  }
151342
151382
  for (const [type, sel] of Object.entries(object.abstractFields?.fields || {})) {
151343
- object.abstractFields.fields[type] = deepMerge(filepath, sel || {}, object.fields);
151383
+ object.abstractFields.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
151344
151384
  }
151345
151385
  for (const [type, options] of Object.entries(typeMap)) {
151346
151386
  object.abstractFields.typeMap[type] = options[0];
@@ -151848,12 +151888,12 @@ ${exportStatement("config")}
151848
151888
  },
151849
151889
  [path_exports2.join(config22.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config22, content, importStatement, exportStatement })
151850
151890
  }),
151851
- ...config22.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config22, plugin2)),
151891
+ ...config22.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config22, docs, plugin2)),
151852
151892
  generatePluginIndex({ config: config22, exportStatement: exportStar })
151853
151893
  ]);
151854
151894
  await generateGraphqlReturnTypes(config22, docs);
151855
151895
  }
151856
- async function generatePluginRuntime(config22, plugin2) {
151896
+ async function generatePluginRuntime(config22, docs, plugin2) {
151857
151897
  if (houdini_mode2.is_testing || !plugin2.includeRuntime) {
151858
151898
  return;
151859
151899
  }
@@ -151870,12 +151910,16 @@ async function generatePluginRuntime(config22, plugin2) {
151870
151910
  });
151871
151911
  }
151872
151912
  const pluginDir = config22.pluginRuntimeDirectory(plugin2.name);
151913
+ let transformMap = plugin2.transformRuntime ?? {};
151914
+ if (transformMap && typeof transformMap === "function") {
151915
+ transformMap = transformMap(docs);
151916
+ }
151873
151917
  await fs_exports2.mkdirp(pluginDir);
151874
151918
  await fs_exports2.recursiveCopy(
151875
151919
  runtime_path,
151876
151920
  pluginDir,
151877
151921
  Object.fromEntries(
151878
- Object.entries(plugin2.transformRuntime ?? {}).map(([key, value2]) => [
151922
+ Object.entries(transformMap).map(([key, value2]) => [
151879
151923
  path_exports2.join(runtime_path, key),
151880
151924
  (content) => value2({ config: config22, content })
151881
151925
  ])
@@ -152299,7 +152343,8 @@ async function generateDocumentTypes(config22, docs) {
152299
152343
  originalParsed: originalDocument,
152300
152344
  name,
152301
152345
  filename,
152302
- generateArtifact
152346
+ generateArtifact,
152347
+ artifact
152303
152348
  }) => {
152304
152349
  if (!generateArtifact) {
152305
152350
  return;
@@ -152338,6 +152383,14 @@ async function generateDocumentTypes(config22, docs) {
152338
152383
  missingScalars
152339
152384
  );
152340
152385
  }
152386
+ program.body.push(
152387
+ AST11.exportNamedDeclaration(
152388
+ AST11.tsTypeAliasDeclaration(
152389
+ AST11.identifier(`${name}$artifact`),
152390
+ convertToTs(serializeValue(artifact))
152391
+ )
152392
+ )
152393
+ );
152341
152394
  await fs_exports2.writeFile(typeDefPath, recast11.print(program).code);
152342
152395
  typePaths.push(typeDefPath);
152343
152396
  }
@@ -152364,18 +152417,17 @@ export * from "${module}"
152364
152417
  `;
152365
152418
  let indexContent = recast11.print(typeIndex).code;
152366
152419
  for (const plugin2 of config22.plugins) {
152367
- if (!plugin2.indexFile) {
152368
- continue;
152420
+ if (plugin2.indexFile) {
152421
+ indexContent = plugin2.indexFile({
152422
+ config: config22,
152423
+ content: indexContent,
152424
+ exportDefaultAs,
152425
+ exportStarFrom: exportStarFrom2,
152426
+ pluginRoot: config22.pluginDirectory(plugin2.name),
152427
+ typedef: true,
152428
+ documents: docs
152429
+ });
152369
152430
  }
152370
- indexContent = plugin2.indexFile({
152371
- config: config22,
152372
- content: indexContent,
152373
- exportDefaultAs,
152374
- exportStarFrom: exportStarFrom2,
152375
- pluginRoot: config22.pluginDirectory(plugin2.name),
152376
- typedef: true,
152377
- documents: docs
152378
- });
152379
152431
  if (plugin2.includeRuntime) {
152380
152432
  indexContent += exportStarFrom2({
152381
152433
  module: "./" + path_exports2.relative(config22.rootDir, config22.pluginRuntimeDirectory(plugin2.name))
@@ -152407,6 +152459,42 @@ ${[...missingScalars].map(
152407
152459
  For more information, please visit this link: ${siteURL}/api/config#custom-scalars`);
152408
152460
  }
152409
152461
  }
152462
+ function convertToTs(source) {
152463
+ if (source.type === "ObjectExpression") {
152464
+ return AST11.tsTypeLiteral(
152465
+ source.properties.reduce(
152466
+ (props, prop) => {
152467
+ if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
152468
+ return props;
152469
+ }
152470
+ return [
152471
+ ...props,
152472
+ AST11.tsPropertySignature(
152473
+ prop.key,
152474
+ AST11.tsTypeAnnotation(convertToTs(prop.value))
152475
+ )
152476
+ ];
152477
+ },
152478
+ []
152479
+ )
152480
+ );
152481
+ }
152482
+ if (source.type === "ArrayExpression") {
152483
+ return AST11.tsTupleType(
152484
+ source.elements.map((element) => convertToTs(element))
152485
+ );
152486
+ }
152487
+ if (source.type === "Literal" && typeof source.value === "boolean") {
152488
+ return AST11.tsLiteralType(AST11.booleanLiteral(source.value));
152489
+ }
152490
+ if (source.type === "Literal" && typeof source.value === "number") {
152491
+ return AST11.tsLiteralType(AST11.numericLiteral(source.value));
152492
+ }
152493
+ if (source.type === "Literal" && typeof source.value === "string") {
152494
+ return AST11.tsLiteralType(AST11.stringLiteral(source.value));
152495
+ }
152496
+ return AST11.tsLiteralType(source);
152497
+ }
152410
152498
  async function generateOperationTypeDefs(config22, filepath, body, definition, selections, visitedTypes, missingScalars) {
152411
152499
  let parentType = null;
152412
152500
  if (definition.operation === "query") {
@@ -153102,9 +153190,6 @@ async function writeIndexFile2(config22, docs) {
153102
153190
  module: relative22(config22.pluginRuntimeDirectory(plugin2.name))
153103
153191
  });
153104
153192
  }
153105
- if (!plugin2.indexFile) {
153106
- continue;
153107
- }
153108
153193
  }
153109
153194
  await fs_exports2.writeFile(path_exports2.join(config22.rootDir, "index.js"), body);
153110
153195
  }
@@ -156706,7 +156791,7 @@ var require_visitor3 = __commonJS4({
156706
156791
  Object.defineProperty(exports, "__esModule", {
156707
156792
  value: true
156708
156793
  });
156709
- exports.visit = visit12;
156794
+ exports.visit = visit13;
156710
156795
  exports.visitInParallel = visitInParallel;
156711
156796
  exports.getVisitFn = getVisitFn;
156712
156797
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -156769,7 +156854,7 @@ var require_visitor3 = __commonJS4({
156769
156854
  exports.QueryDocumentKeys = QueryDocumentKeys;
156770
156855
  var BREAK = Object.freeze({});
156771
156856
  exports.BREAK = BREAK;
156772
- function visit12(root, visitor) {
156857
+ function visit13(root, visitor) {
156773
156858
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
156774
156859
  var stack = void 0;
156775
156860
  var inArray = Array.isArray(root);
@@ -191634,6 +191719,107 @@ var require_lib33 = __commonJS4({
191634
191719
  exports.tokTypes = tokTypes;
191635
191720
  }
191636
191721
  });
191722
+ var require_cjs3 = __commonJS4({
191723
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
191724
+ "use strict";
191725
+ var isMergeableObject = function isMergeableObject2(value2) {
191726
+ return isNonNullObject(value2) && !isSpecial(value2);
191727
+ };
191728
+ function isNonNullObject(value2) {
191729
+ return !!value2 && typeof value2 === "object";
191730
+ }
191731
+ function isSpecial(value2) {
191732
+ var stringValue = Object.prototype.toString.call(value2);
191733
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
191734
+ }
191735
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
191736
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
191737
+ function isReactElement(value2) {
191738
+ return value2.$$typeof === REACT_ELEMENT_TYPE;
191739
+ }
191740
+ function emptyTarget(val) {
191741
+ return Array.isArray(val) ? [] : {};
191742
+ }
191743
+ function cloneUnlessOtherwiseSpecified(value2, options) {
191744
+ return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
191745
+ }
191746
+ function defaultArrayMerge(target, source, options) {
191747
+ return target.concat(source).map(function(element) {
191748
+ return cloneUnlessOtherwiseSpecified(element, options);
191749
+ });
191750
+ }
191751
+ function getMergeFunction(key, options) {
191752
+ if (!options.customMerge) {
191753
+ return deepmerge;
191754
+ }
191755
+ var customMerge = options.customMerge(key);
191756
+ return typeof customMerge === "function" ? customMerge : deepmerge;
191757
+ }
191758
+ function getEnumerableOwnPropertySymbols(target) {
191759
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
191760
+ return target.propertyIsEnumerable(symbol);
191761
+ }) : [];
191762
+ }
191763
+ function getKeys(target) {
191764
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
191765
+ }
191766
+ function propertyIsOnObject(object, property) {
191767
+ try {
191768
+ return property in object;
191769
+ } catch (_) {
191770
+ return false;
191771
+ }
191772
+ }
191773
+ function propertyIsUnsafe(target, key) {
191774
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
191775
+ }
191776
+ function mergeObject(target, source, options) {
191777
+ var destination = {};
191778
+ if (options.isMergeableObject(target)) {
191779
+ getKeys(target).forEach(function(key) {
191780
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
191781
+ });
191782
+ }
191783
+ getKeys(source).forEach(function(key) {
191784
+ if (propertyIsUnsafe(target, key)) {
191785
+ return;
191786
+ }
191787
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
191788
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
191789
+ } else {
191790
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
191791
+ }
191792
+ });
191793
+ return destination;
191794
+ }
191795
+ function deepmerge(target, source, options) {
191796
+ options = options || {};
191797
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
191798
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
191799
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
191800
+ var sourceIsArray = Array.isArray(source);
191801
+ var targetIsArray = Array.isArray(target);
191802
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
191803
+ if (!sourceAndTargetTypesMatch) {
191804
+ return cloneUnlessOtherwiseSpecified(source, options);
191805
+ } else if (sourceIsArray) {
191806
+ return options.arrayMerge(target, source, options);
191807
+ } else {
191808
+ return mergeObject(target, source, options);
191809
+ }
191810
+ }
191811
+ deepmerge.all = function deepmergeAll(array, options) {
191812
+ if (!Array.isArray(array)) {
191813
+ throw new Error("first argument should be an array");
191814
+ }
191815
+ return array.reduce(function(prev, next) {
191816
+ return deepmerge(prev, next, options);
191817
+ }, {});
191818
+ };
191819
+ var deepmerge_1 = deepmerge;
191820
+ module.exports = deepmerge_1;
191821
+ }
191822
+ });
191637
191823
  var require_tslib3 = __commonJS4({
191638
191824
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module) {
191639
191825
  var __extends;
@@ -193890,7 +194076,7 @@ var require_path_visitor3 = __commonJS4({
193890
194076
  }
193891
194077
  return target;
193892
194078
  }
193893
- PathVisitor.visit = function visit12(node2, methods) {
194079
+ PathVisitor.visit = function visit13(node2, methods) {
193894
194080
  return PathVisitor.fromMethodsObject(methods).visit(node2);
193895
194081
  };
193896
194082
  var PVp = PathVisitor.prototype;
@@ -194081,7 +194267,7 @@ var require_path_visitor3 = __commonJS4({
194081
194267
  this.needToCallTraverse = false;
194082
194268
  return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
194083
194269
  };
194084
- sharedContextProtoMethods.visit = function visit12(path22, newVisitor) {
194270
+ sharedContextProtoMethods.visit = function visit13(path22, newVisitor) {
194085
194271
  if (!(this instanceof this.Context)) {
194086
194272
  throw new Error("");
194087
194273
  }
@@ -195424,7 +195610,7 @@ var require_main4 = __commonJS4({
195424
195610
  var someField = _a.someField;
195425
195611
  var Type = _a.Type;
195426
195612
  var use = _a.use;
195427
- var visit12 = _a.visit;
195613
+ var visit13 = _a.visit;
195428
195614
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
195429
195615
  exports.builders = builders;
195430
195616
  exports.builtInTypes = builtInTypes;
@@ -195441,7 +195627,7 @@ var require_main4 = __commonJS4({
195441
195627
  exports.someField = someField;
195442
195628
  exports.Type = Type;
195443
195629
  exports.use = use;
195444
- exports.visit = visit12;
195630
+ exports.visit = visit13;
195445
195631
  Object.assign(namedTypes_1.namedTypes, n);
195446
195632
  }
195447
195633
  });
@@ -207856,107 +208042,6 @@ var require_main23 = __commonJS4({
207856
208042
  }
207857
208043
  }
207858
208044
  });
207859
- var require_cjs3 = __commonJS4({
207860
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
207861
- "use strict";
207862
- var isMergeableObject = function isMergeableObject2(value2) {
207863
- return isNonNullObject(value2) && !isSpecial(value2);
207864
- };
207865
- function isNonNullObject(value2) {
207866
- return !!value2 && typeof value2 === "object";
207867
- }
207868
- function isSpecial(value2) {
207869
- var stringValue = Object.prototype.toString.call(value2);
207870
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
207871
- }
207872
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
207873
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
207874
- function isReactElement(value2) {
207875
- return value2.$$typeof === REACT_ELEMENT_TYPE;
207876
- }
207877
- function emptyTarget(val) {
207878
- return Array.isArray(val) ? [] : {};
207879
- }
207880
- function cloneUnlessOtherwiseSpecified(value2, options) {
207881
- return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
207882
- }
207883
- function defaultArrayMerge(target, source, options) {
207884
- return target.concat(source).map(function(element) {
207885
- return cloneUnlessOtherwiseSpecified(element, options);
207886
- });
207887
- }
207888
- function getMergeFunction(key, options) {
207889
- if (!options.customMerge) {
207890
- return deepmerge;
207891
- }
207892
- var customMerge = options.customMerge(key);
207893
- return typeof customMerge === "function" ? customMerge : deepmerge;
207894
- }
207895
- function getEnumerableOwnPropertySymbols(target) {
207896
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
207897
- return target.propertyIsEnumerable(symbol);
207898
- }) : [];
207899
- }
207900
- function getKeys(target) {
207901
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
207902
- }
207903
- function propertyIsOnObject(object, property) {
207904
- try {
207905
- return property in object;
207906
- } catch (_) {
207907
- return false;
207908
- }
207909
- }
207910
- function propertyIsUnsafe(target, key) {
207911
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
207912
- }
207913
- function mergeObject(target, source, options) {
207914
- var destination = {};
207915
- if (options.isMergeableObject(target)) {
207916
- getKeys(target).forEach(function(key) {
207917
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
207918
- });
207919
- }
207920
- getKeys(source).forEach(function(key) {
207921
- if (propertyIsUnsafe(target, key)) {
207922
- return;
207923
- }
207924
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
207925
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
207926
- } else {
207927
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
207928
- }
207929
- });
207930
- return destination;
207931
- }
207932
- function deepmerge(target, source, options) {
207933
- options = options || {};
207934
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
207935
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
207936
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
207937
- var sourceIsArray = Array.isArray(source);
207938
- var targetIsArray = Array.isArray(target);
207939
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
207940
- if (!sourceAndTargetTypesMatch) {
207941
- return cloneUnlessOtherwiseSpecified(source, options);
207942
- } else if (sourceIsArray) {
207943
- return options.arrayMerge(target, source, options);
207944
- } else {
207945
- return mergeObject(target, source, options);
207946
- }
207947
- }
207948
- deepmerge.all = function deepmergeAll(array, options) {
207949
- if (!Array.isArray(array)) {
207950
- throw new Error("first argument should be an array");
207951
- }
207952
- return array.reduce(function(prev, next) {
207953
- return deepmerge(prev, next, options);
207954
- }, {});
207955
- };
207956
- var deepmerge_1 = deepmerge;
207957
- module.exports = deepmerge_1;
207958
- }
207959
- });
207960
208045
  var graphql252 = __toESM4(require_graphql23(), 1);
207961
208046
  var import_memfs22 = __toESM4(require_lib5(), 1);
207962
208047
  var graphql27 = __toESM4(require_graphql23(), 1);
@@ -210397,10 +210482,11 @@ var query3 = documentPlugin3(ArtifactKind3.Query, function() {
210397
210482
  cache_default3.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
210398
210483
  }
210399
210484
  lastVariables = { ...marshalVariables(ctx) };
210485
+ const variables = lastVariables;
210400
210486
  subscriptionSpec = {
210401
210487
  rootType: ctx.artifact.rootType,
210402
210488
  selection: ctx.artifact.selection,
210403
- variables: () => lastVariables,
210489
+ variables: () => variables,
210404
210490
  set: (newValue) => {
210405
210491
  resolve22(ctx, {
210406
210492
  data: newValue,
@@ -210427,12 +210513,17 @@ var query3 = documentPlugin3(ArtifactKind3.Query, function() {
210427
210513
  });
210428
210514
  var fragment3 = documentPlugin3(ArtifactKind3.Fragment, function() {
210429
210515
  let subscriptionSpec = null;
210516
+ let lastReference = null;
210430
210517
  return {
210431
210518
  start(ctx, { next, resolve: resolve22, variablesChanged, marshalVariables }) {
210432
210519
  if (!ctx.stuff.parentID) {
210433
210520
  return next(ctx);
210434
210521
  }
210435
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
210522
+ const currentReference = {
210523
+ parent: ctx.stuff.parentID,
210524
+ variables: marshalVariables(ctx)
210525
+ };
210526
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals3(lastReference, currentReference) || variablesChanged(ctx))) {
210436
210527
  if (subscriptionSpec) {
210437
210528
  cache_default3.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
210438
210529
  }
@@ -210455,6 +210546,7 @@ var fragment3 = documentPlugin3(ArtifactKind3.Fragment, function() {
210455
210546
  }
210456
210547
  };
210457
210548
  cache_default3.subscribe(subscriptionSpec, variables);
210549
+ lastReference = currentReference;
210458
210550
  }
210459
210551
  next(ctx);
210460
210552
  },
@@ -210956,6 +211048,17 @@ var Config = class {
210956
211048
  }, []) ?? [];
210957
211049
  return !defaultDirectives3.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
210958
211050
  }
211051
+ needsRefetchArtifact(document2) {
211052
+ let needsArtifact = false;
211053
+ graphql27.visit(document2, {
211054
+ Directive: (node2) => {
211055
+ if ([this.paginateDirective].includes(node2.name.value)) {
211056
+ needsArtifact = true;
211057
+ }
211058
+ }
211059
+ });
211060
+ return needsArtifact;
211061
+ }
210959
211062
  #fragmentVariableMaps;
210960
211063
  registerFragmentVariablesHash({
210961
211064
  hash,
@@ -211081,9 +211184,9 @@ var emptySchema3 = graphql27.buildSchema("type Query { hello: String }");
211081
211184
  var defaultDirectives3 = emptySchema3.getDirectives().map((dir) => dir.name);
211082
211185
  var graphql28 = __toESM4(require_graphql23(), 1);
211083
211186
  var import_parser3 = __toESM4(require_lib33(), 1);
211187
+ var import_deepmerge3 = __toESM4(require_cjs3(), 1);
211084
211188
  var recast14 = __toESM4(require_main23(), 1);
211085
211189
  var AST14 = recast14.types.builders;
211086
- var import_deepmerge3 = __toESM4(require_cjs3(), 1);
211087
211190
  var graphql122 = __toESM4(require_graphql23(), 1);
211088
211191
  var recast52 = __toESM4(require_main23(), 1);
211089
211192
  var recast23 = __toESM4(require_main23(), 1);
@@ -218043,7 +218146,7 @@ var require_visitor5 = __commonJS5({
218043
218146
  Object.defineProperty(exports, "__esModule", {
218044
218147
  value: true
218045
218148
  });
218046
- exports.visit = visit13;
218149
+ exports.visit = visit14;
218047
218150
  exports.visitInParallel = visitInParallel;
218048
218151
  exports.getVisitFn = getVisitFn;
218049
218152
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -218106,7 +218209,7 @@ var require_visitor5 = __commonJS5({
218106
218209
  exports.QueryDocumentKeys = QueryDocumentKeys;
218107
218210
  var BREAK = Object.freeze({});
218108
218211
  exports.BREAK = BREAK;
218109
- function visit13(root, visitor) {
218212
+ function visit14(root, visitor) {
218110
218213
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
218111
218214
  var stack = void 0;
218112
218215
  var inArray = Array.isArray(root);
@@ -256577,6 +256680,107 @@ var require_lib34 = __commonJS5({
256577
256680
  exports.tokTypes = tokTypes;
256578
256681
  }
256579
256682
  });
256683
+ var require_cjs4 = __commonJS5({
256684
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
256685
+ "use strict";
256686
+ var isMergeableObject = function isMergeableObject2(value2) {
256687
+ return isNonNullObject(value2) && !isSpecial(value2);
256688
+ };
256689
+ function isNonNullObject(value2) {
256690
+ return !!value2 && typeof value2 === "object";
256691
+ }
256692
+ function isSpecial(value2) {
256693
+ var stringValue = Object.prototype.toString.call(value2);
256694
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
256695
+ }
256696
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
256697
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
256698
+ function isReactElement(value2) {
256699
+ return value2.$$typeof === REACT_ELEMENT_TYPE;
256700
+ }
256701
+ function emptyTarget(val) {
256702
+ return Array.isArray(val) ? [] : {};
256703
+ }
256704
+ function cloneUnlessOtherwiseSpecified(value2, options) {
256705
+ return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
256706
+ }
256707
+ function defaultArrayMerge(target, source, options) {
256708
+ return target.concat(source).map(function(element) {
256709
+ return cloneUnlessOtherwiseSpecified(element, options);
256710
+ });
256711
+ }
256712
+ function getMergeFunction(key, options) {
256713
+ if (!options.customMerge) {
256714
+ return deepmerge;
256715
+ }
256716
+ var customMerge = options.customMerge(key);
256717
+ return typeof customMerge === "function" ? customMerge : deepmerge;
256718
+ }
256719
+ function getEnumerableOwnPropertySymbols(target) {
256720
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
256721
+ return target.propertyIsEnumerable(symbol);
256722
+ }) : [];
256723
+ }
256724
+ function getKeys(target) {
256725
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
256726
+ }
256727
+ function propertyIsOnObject(object, property) {
256728
+ try {
256729
+ return property in object;
256730
+ } catch (_) {
256731
+ return false;
256732
+ }
256733
+ }
256734
+ function propertyIsUnsafe(target, key) {
256735
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
256736
+ }
256737
+ function mergeObject(target, source, options) {
256738
+ var destination = {};
256739
+ if (options.isMergeableObject(target)) {
256740
+ getKeys(target).forEach(function(key) {
256741
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
256742
+ });
256743
+ }
256744
+ getKeys(source).forEach(function(key) {
256745
+ if (propertyIsUnsafe(target, key)) {
256746
+ return;
256747
+ }
256748
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
256749
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
256750
+ } else {
256751
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
256752
+ }
256753
+ });
256754
+ return destination;
256755
+ }
256756
+ function deepmerge(target, source, options) {
256757
+ options = options || {};
256758
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
256759
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
256760
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
256761
+ var sourceIsArray = Array.isArray(source);
256762
+ var targetIsArray = Array.isArray(target);
256763
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
256764
+ if (!sourceAndTargetTypesMatch) {
256765
+ return cloneUnlessOtherwiseSpecified(source, options);
256766
+ } else if (sourceIsArray) {
256767
+ return options.arrayMerge(target, source, options);
256768
+ } else {
256769
+ return mergeObject(target, source, options);
256770
+ }
256771
+ }
256772
+ deepmerge.all = function deepmergeAll(array, options) {
256773
+ if (!Array.isArray(array)) {
256774
+ throw new Error("first argument should be an array");
256775
+ }
256776
+ return array.reduce(function(prev, next) {
256777
+ return deepmerge(prev, next, options);
256778
+ }, {});
256779
+ };
256780
+ var deepmerge_1 = deepmerge;
256781
+ module.exports = deepmerge_1;
256782
+ }
256783
+ });
256580
256784
  var require_tslib4 = __commonJS5({
256581
256785
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module) {
256582
256786
  var __extends;
@@ -258833,7 +259037,7 @@ var require_path_visitor4 = __commonJS5({
258833
259037
  }
258834
259038
  return target;
258835
259039
  }
258836
- PathVisitor.visit = function visit13(node2, methods) {
259040
+ PathVisitor.visit = function visit14(node2, methods) {
258837
259041
  return PathVisitor.fromMethodsObject(methods).visit(node2);
258838
259042
  };
258839
259043
  var PVp = PathVisitor.prototype;
@@ -259024,7 +259228,7 @@ var require_path_visitor4 = __commonJS5({
259024
259228
  this.needToCallTraverse = false;
259025
259229
  return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
259026
259230
  };
259027
- sharedContextProtoMethods.visit = function visit13(path22, newVisitor) {
259231
+ sharedContextProtoMethods.visit = function visit14(path22, newVisitor) {
259028
259232
  if (!(this instanceof this.Context)) {
259029
259233
  throw new Error("");
259030
259234
  }
@@ -260367,7 +260571,7 @@ var require_main5 = __commonJS5({
260367
260571
  var someField = _a.someField;
260368
260572
  var Type = _a.Type;
260369
260573
  var use = _a.use;
260370
- var visit13 = _a.visit;
260574
+ var visit14 = _a.visit;
260371
260575
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
260372
260576
  exports.builders = builders;
260373
260577
  exports.builtInTypes = builtInTypes;
@@ -260384,7 +260588,7 @@ var require_main5 = __commonJS5({
260384
260588
  exports.someField = someField;
260385
260589
  exports.Type = Type;
260386
260590
  exports.use = use;
260387
- exports.visit = visit13;
260591
+ exports.visit = visit14;
260388
260592
  Object.assign(namedTypes_1.namedTypes, n);
260389
260593
  }
260390
260594
  });
@@ -272799,107 +273003,6 @@ var require_main24 = __commonJS5({
272799
273003
  }
272800
273004
  }
272801
273005
  });
272802
- var require_cjs4 = __commonJS5({
272803
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
272804
- "use strict";
272805
- var isMergeableObject = function isMergeableObject2(value2) {
272806
- return isNonNullObject(value2) && !isSpecial(value2);
272807
- };
272808
- function isNonNullObject(value2) {
272809
- return !!value2 && typeof value2 === "object";
272810
- }
272811
- function isSpecial(value2) {
272812
- var stringValue = Object.prototype.toString.call(value2);
272813
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
272814
- }
272815
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
272816
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
272817
- function isReactElement(value2) {
272818
- return value2.$$typeof === REACT_ELEMENT_TYPE;
272819
- }
272820
- function emptyTarget(val) {
272821
- return Array.isArray(val) ? [] : {};
272822
- }
272823
- function cloneUnlessOtherwiseSpecified(value2, options) {
272824
- return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
272825
- }
272826
- function defaultArrayMerge(target, source, options) {
272827
- return target.concat(source).map(function(element) {
272828
- return cloneUnlessOtherwiseSpecified(element, options);
272829
- });
272830
- }
272831
- function getMergeFunction(key, options) {
272832
- if (!options.customMerge) {
272833
- return deepmerge;
272834
- }
272835
- var customMerge = options.customMerge(key);
272836
- return typeof customMerge === "function" ? customMerge : deepmerge;
272837
- }
272838
- function getEnumerableOwnPropertySymbols(target) {
272839
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
272840
- return target.propertyIsEnumerable(symbol);
272841
- }) : [];
272842
- }
272843
- function getKeys(target) {
272844
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
272845
- }
272846
- function propertyIsOnObject(object, property) {
272847
- try {
272848
- return property in object;
272849
- } catch (_) {
272850
- return false;
272851
- }
272852
- }
272853
- function propertyIsUnsafe(target, key) {
272854
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
272855
- }
272856
- function mergeObject(target, source, options) {
272857
- var destination = {};
272858
- if (options.isMergeableObject(target)) {
272859
- getKeys(target).forEach(function(key) {
272860
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
272861
- });
272862
- }
272863
- getKeys(source).forEach(function(key) {
272864
- if (propertyIsUnsafe(target, key)) {
272865
- return;
272866
- }
272867
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
272868
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
272869
- } else {
272870
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
272871
- }
272872
- });
272873
- return destination;
272874
- }
272875
- function deepmerge(target, source, options) {
272876
- options = options || {};
272877
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
272878
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
272879
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
272880
- var sourceIsArray = Array.isArray(source);
272881
- var targetIsArray = Array.isArray(target);
272882
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
272883
- if (!sourceAndTargetTypesMatch) {
272884
- return cloneUnlessOtherwiseSpecified(source, options);
272885
- } else if (sourceIsArray) {
272886
- return options.arrayMerge(target, source, options);
272887
- } else {
272888
- return mergeObject(target, source, options);
272889
- }
272890
- }
272891
- deepmerge.all = function deepmergeAll(array, options) {
272892
- if (!Array.isArray(array)) {
272893
- throw new Error("first argument should be an array");
272894
- }
272895
- return array.reduce(function(prev, next) {
272896
- return deepmerge(prev, next, options);
272897
- }, {});
272898
- };
272899
- var deepmerge_1 = deepmerge;
272900
- module.exports = deepmerge_1;
272901
- }
272902
- });
272903
273006
  var import_minimatch22 = __toESM5(require_minimatch4(), 1);
272904
273007
  var config2 = {
272905
273008
  reset: {
@@ -276353,10 +276456,11 @@ var query4 = documentPlugin4(ArtifactKind4.Query, function() {
276353
276456
  cache_default4.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
276354
276457
  }
276355
276458
  lastVariables = { ...marshalVariables(ctx) };
276459
+ const variables = lastVariables;
276356
276460
  subscriptionSpec = {
276357
276461
  rootType: ctx.artifact.rootType,
276358
276462
  selection: ctx.artifact.selection,
276359
- variables: () => lastVariables,
276463
+ variables: () => variables,
276360
276464
  set: (newValue) => {
276361
276465
  resolve22(ctx, {
276362
276466
  data: newValue,
@@ -276383,12 +276487,17 @@ var query4 = documentPlugin4(ArtifactKind4.Query, function() {
276383
276487
  });
276384
276488
  var fragment4 = documentPlugin4(ArtifactKind4.Fragment, function() {
276385
276489
  let subscriptionSpec = null;
276490
+ let lastReference = null;
276386
276491
  return {
276387
276492
  start(ctx, { next, resolve: resolve22, variablesChanged, marshalVariables }) {
276388
276493
  if (!ctx.stuff.parentID) {
276389
276494
  return next(ctx);
276390
276495
  }
276391
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
276496
+ const currentReference = {
276497
+ parent: ctx.stuff.parentID,
276498
+ variables: marshalVariables(ctx)
276499
+ };
276500
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals4(lastReference, currentReference) || variablesChanged(ctx))) {
276392
276501
  if (subscriptionSpec) {
276393
276502
  cache_default4.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
276394
276503
  }
@@ -276411,6 +276520,7 @@ var fragment4 = documentPlugin4(ArtifactKind4.Fragment, function() {
276411
276520
  }
276412
276521
  };
276413
276522
  cache_default4.subscribe(subscriptionSpec, variables);
276523
+ lastReference = currentReference;
276414
276524
  }
276415
276525
  next(ctx);
276416
276526
  },
@@ -276476,9 +276586,9 @@ var emptySchema4 = graphql210.buildSchema("type Query { hello: String }");
276476
276586
  var defaultDirectives4 = emptySchema4.getDirectives().map((dir) => dir.name);
276477
276587
  var graphql34 = __toESM5(require_graphql24(), 1);
276478
276588
  var import_parser4 = __toESM5(require_lib34(), 1);
276589
+ var import_deepmerge4 = __toESM5(require_cjs4(), 1);
276479
276590
  var recast15 = __toESM5(require_main24(), 1);
276480
276591
  var AST15 = recast15.types.builders;
276481
- var import_deepmerge4 = __toESM5(require_cjs4(), 1);
276482
276592
  var graphql44 = __toESM5(require_graphql24(), 1);
276483
276593
  var graphql143 = __toESM5(require_graphql24(), 1);
276484
276594
  var recast53 = __toESM5(require_main24(), 1);