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
@@ -33432,7 +33432,7 @@ var require_visitor = __commonJS2({
33432
33432
  Object.defineProperty(exports, "__esModule", {
33433
33433
  value: true
33434
33434
  });
33435
- exports.visit = visit2;
33435
+ exports.visit = visit3;
33436
33436
  exports.visitInParallel = visitInParallel;
33437
33437
  exports.getVisitFn = getVisitFn;
33438
33438
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -33495,7 +33495,7 @@ var require_visitor = __commonJS2({
33495
33495
  exports.QueryDocumentKeys = QueryDocumentKeys;
33496
33496
  var BREAK = Object.freeze({});
33497
33497
  exports.BREAK = BREAK;
33498
- function visit2(root, visitor) {
33498
+ function visit3(root, visitor) {
33499
33499
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
33500
33500
  var stack = void 0;
33501
33501
  var inArray = Array.isArray(root);
@@ -72721,6 +72721,107 @@ var require_lib3 = __commonJS2({
72721
72721
  exports.tokTypes = tokTypes;
72722
72722
  }
72723
72723
  });
72724
+ var require_cjs = __commonJS2({
72725
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
72726
+ "use strict";
72727
+ var isMergeableObject = function isMergeableObject2(value2) {
72728
+ return isNonNullObject(value2) && !isSpecial(value2);
72729
+ };
72730
+ function isNonNullObject(value2) {
72731
+ return !!value2 && typeof value2 === "object";
72732
+ }
72733
+ function isSpecial(value2) {
72734
+ var stringValue = Object.prototype.toString.call(value2);
72735
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
72736
+ }
72737
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
72738
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
72739
+ function isReactElement(value2) {
72740
+ return value2.$$typeof === REACT_ELEMENT_TYPE;
72741
+ }
72742
+ function emptyTarget(val) {
72743
+ return Array.isArray(val) ? [] : {};
72744
+ }
72745
+ function cloneUnlessOtherwiseSpecified(value2, options) {
72746
+ return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
72747
+ }
72748
+ function defaultArrayMerge(target, source, options) {
72749
+ return target.concat(source).map(function(element) {
72750
+ return cloneUnlessOtherwiseSpecified(element, options);
72751
+ });
72752
+ }
72753
+ function getMergeFunction(key, options) {
72754
+ if (!options.customMerge) {
72755
+ return deepmerge;
72756
+ }
72757
+ var customMerge = options.customMerge(key);
72758
+ return typeof customMerge === "function" ? customMerge : deepmerge;
72759
+ }
72760
+ function getEnumerableOwnPropertySymbols(target) {
72761
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
72762
+ return target.propertyIsEnumerable(symbol);
72763
+ }) : [];
72764
+ }
72765
+ function getKeys(target) {
72766
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
72767
+ }
72768
+ function propertyIsOnObject(object, property) {
72769
+ try {
72770
+ return property in object;
72771
+ } catch (_) {
72772
+ return false;
72773
+ }
72774
+ }
72775
+ function propertyIsUnsafe(target, key) {
72776
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
72777
+ }
72778
+ function mergeObject(target, source, options) {
72779
+ var destination = {};
72780
+ if (options.isMergeableObject(target)) {
72781
+ getKeys(target).forEach(function(key) {
72782
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
72783
+ });
72784
+ }
72785
+ getKeys(source).forEach(function(key) {
72786
+ if (propertyIsUnsafe(target, key)) {
72787
+ return;
72788
+ }
72789
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
72790
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
72791
+ } else {
72792
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
72793
+ }
72794
+ });
72795
+ return destination;
72796
+ }
72797
+ function deepmerge(target, source, options) {
72798
+ options = options || {};
72799
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
72800
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
72801
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
72802
+ var sourceIsArray = Array.isArray(source);
72803
+ var targetIsArray = Array.isArray(target);
72804
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
72805
+ if (!sourceAndTargetTypesMatch) {
72806
+ return cloneUnlessOtherwiseSpecified(source, options);
72807
+ } else if (sourceIsArray) {
72808
+ return options.arrayMerge(target, source, options);
72809
+ } else {
72810
+ return mergeObject(target, source, options);
72811
+ }
72812
+ }
72813
+ deepmerge.all = function deepmergeAll(array, options) {
72814
+ if (!Array.isArray(array)) {
72815
+ throw new Error("first argument should be an array");
72816
+ }
72817
+ return array.reduce(function(prev, next) {
72818
+ return deepmerge(prev, next, options);
72819
+ }, {});
72820
+ };
72821
+ var deepmerge_1 = deepmerge;
72822
+ module2.exports = deepmerge_1;
72823
+ }
72824
+ });
72724
72825
  var require_tslib = __commonJS2({
72725
72826
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module2) {
72726
72827
  var __extends;
@@ -74977,7 +75078,7 @@ var require_path_visitor = __commonJS2({
74977
75078
  }
74978
75079
  return target;
74979
75080
  }
74980
- PathVisitor.visit = function visit2(node2, methods) {
75081
+ PathVisitor.visit = function visit3(node2, methods) {
74981
75082
  return PathVisitor.fromMethodsObject(methods).visit(node2);
74982
75083
  };
74983
75084
  var PVp = PathVisitor.prototype;
@@ -75168,7 +75269,7 @@ var require_path_visitor = __commonJS2({
75168
75269
  this.needToCallTraverse = false;
75169
75270
  return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
75170
75271
  };
75171
- sharedContextProtoMethods.visit = function visit2(path22, newVisitor) {
75272
+ sharedContextProtoMethods.visit = function visit3(path22, newVisitor) {
75172
75273
  if (!(this instanceof this.Context)) {
75173
75274
  throw new Error("");
75174
75275
  }
@@ -76511,7 +76612,7 @@ var require_main = __commonJS2({
76511
76612
  var someField = _a.someField;
76512
76613
  var Type = _a.Type;
76513
76614
  var use = _a.use;
76514
- var visit2 = _a.visit;
76615
+ var visit3 = _a.visit;
76515
76616
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
76516
76617
  exports.builders = builders;
76517
76618
  exports.builtInTypes = builtInTypes;
@@ -76528,7 +76629,7 @@ var require_main = __commonJS2({
76528
76629
  exports.someField = someField;
76529
76630
  exports.Type = Type;
76530
76631
  exports.use = use;
76531
- exports.visit = visit2;
76632
+ exports.visit = visit3;
76532
76633
  Object.assign(namedTypes_1.namedTypes, n);
76533
76634
  }
76534
76635
  });
@@ -88943,107 +89044,6 @@ var require_main2 = __commonJS2({
88943
89044
  }
88944
89045
  }
88945
89046
  });
88946
- var require_cjs = __commonJS2({
88947
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
88948
- "use strict";
88949
- var isMergeableObject = function isMergeableObject2(value2) {
88950
- return isNonNullObject(value2) && !isSpecial(value2);
88951
- };
88952
- function isNonNullObject(value2) {
88953
- return !!value2 && typeof value2 === "object";
88954
- }
88955
- function isSpecial(value2) {
88956
- var stringValue = Object.prototype.toString.call(value2);
88957
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
88958
- }
88959
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
88960
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
88961
- function isReactElement(value2) {
88962
- return value2.$$typeof === REACT_ELEMENT_TYPE;
88963
- }
88964
- function emptyTarget(val) {
88965
- return Array.isArray(val) ? [] : {};
88966
- }
88967
- function cloneUnlessOtherwiseSpecified(value2, options) {
88968
- return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
88969
- }
88970
- function defaultArrayMerge(target, source, options) {
88971
- return target.concat(source).map(function(element) {
88972
- return cloneUnlessOtherwiseSpecified(element, options);
88973
- });
88974
- }
88975
- function getMergeFunction(key, options) {
88976
- if (!options.customMerge) {
88977
- return deepmerge;
88978
- }
88979
- var customMerge = options.customMerge(key);
88980
- return typeof customMerge === "function" ? customMerge : deepmerge;
88981
- }
88982
- function getEnumerableOwnPropertySymbols(target) {
88983
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
88984
- return target.propertyIsEnumerable(symbol);
88985
- }) : [];
88986
- }
88987
- function getKeys(target) {
88988
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
88989
- }
88990
- function propertyIsOnObject(object, property) {
88991
- try {
88992
- return property in object;
88993
- } catch (_) {
88994
- return false;
88995
- }
88996
- }
88997
- function propertyIsUnsafe(target, key) {
88998
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
88999
- }
89000
- function mergeObject(target, source, options) {
89001
- var destination = {};
89002
- if (options.isMergeableObject(target)) {
89003
- getKeys(target).forEach(function(key) {
89004
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
89005
- });
89006
- }
89007
- getKeys(source).forEach(function(key) {
89008
- if (propertyIsUnsafe(target, key)) {
89009
- return;
89010
- }
89011
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
89012
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
89013
- } else {
89014
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
89015
- }
89016
- });
89017
- return destination;
89018
- }
89019
- function deepmerge(target, source, options) {
89020
- options = options || {};
89021
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
89022
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
89023
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
89024
- var sourceIsArray = Array.isArray(source);
89025
- var targetIsArray = Array.isArray(target);
89026
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
89027
- if (!sourceAndTargetTypesMatch) {
89028
- return cloneUnlessOtherwiseSpecified(source, options);
89029
- } else if (sourceIsArray) {
89030
- return options.arrayMerge(target, source, options);
89031
- } else {
89032
- return mergeObject(target, source, options);
89033
- }
89034
- }
89035
- deepmerge.all = function deepmergeAll(array, options) {
89036
- if (!Array.isArray(array)) {
89037
- throw new Error("first argument should be an array");
89038
- }
89039
- return array.reduce(function(prev, next) {
89040
- return deepmerge(prev, next, options);
89041
- }, {});
89042
- };
89043
- var deepmerge_1 = deepmerge;
89044
- module2.exports = deepmerge_1;
89045
- }
89046
- });
89047
89047
  async function runPipeline(config4, pipeline22, target) {
89048
89048
  for (const transform of pipeline22) {
89049
89049
  await transform?.(config4, target);
@@ -95699,10 +95699,11 @@ var query = documentPlugin(ArtifactKind.Query, function() {
95699
95699
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
95700
95700
  }
95701
95701
  lastVariables = { ...marshalVariables2(ctx) };
95702
+ const variables = lastVariables;
95702
95703
  subscriptionSpec = {
95703
95704
  rootType: ctx.artifact.rootType,
95704
95705
  selection: ctx.artifact.selection,
95705
- variables: () => lastVariables,
95706
+ variables: () => variables,
95706
95707
  set: (newValue) => {
95707
95708
  resolve22(ctx, {
95708
95709
  data: newValue,
@@ -95729,12 +95730,17 @@ var query = documentPlugin(ArtifactKind.Query, function() {
95729
95730
  });
95730
95731
  var fragment = documentPlugin(ArtifactKind.Fragment, function() {
95731
95732
  let subscriptionSpec = null;
95733
+ let lastReference = null;
95732
95734
  return {
95733
95735
  start(ctx, { next, resolve: resolve22, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
95734
95736
  if (!ctx.stuff.parentID) {
95735
95737
  return next(ctx);
95736
95738
  }
95737
- if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
95739
+ const currentReference = {
95740
+ parent: ctx.stuff.parentID,
95741
+ variables: marshalVariables2(ctx)
95742
+ };
95743
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
95738
95744
  if (subscriptionSpec) {
95739
95745
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
95740
95746
  }
@@ -95757,6 +95763,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
95757
95763
  }
95758
95764
  };
95759
95765
  cache_default.subscribe(subscriptionSpec, variables);
95766
+ lastReference = currentReference;
95760
95767
  }
95761
95768
  next(ctx);
95762
95769
  },
@@ -96258,6 +96265,17 @@ var Config = class {
96258
96265
  }, []) ?? [];
96259
96266
  return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
96260
96267
  }
96268
+ needsRefetchArtifact(document2) {
96269
+ let needsArtifact = false;
96270
+ graphql2.visit(document2, {
96271
+ Directive: (node2) => {
96272
+ if ([this.paginateDirective].includes(node2.name.value)) {
96273
+ needsArtifact = true;
96274
+ }
96275
+ }
96276
+ });
96277
+ return needsArtifact;
96278
+ }
96261
96279
  #fragmentVariableMaps;
96262
96280
  registerFragmentVariablesHash({
96263
96281
  hash,
@@ -96628,19 +96646,41 @@ var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
96628
96646
  return TypeWrapper2;
96629
96647
  })(TypeWrapper || {});
96630
96648
  var import_parser = __toESM2(require_lib3(), 1);
96631
- async function parseJS(str) {
96649
+ var import_deepmerge = __toESM2(require_cjs(), 1);
96650
+ function deepMerge(filepath, ...targets) {
96651
+ try {
96652
+ if (targets.length === 1) {
96653
+ return targets[0];
96654
+ } else if (targets.length === 2) {
96655
+ return (0, import_deepmerge.default)(targets[0], targets[1], {
96656
+ arrayMerge: (source, update) => [...new Set(source.concat(update))]
96657
+ });
96658
+ }
96659
+ return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
96660
+ } catch (e22) {
96661
+ throw new HoudiniError({
96662
+ filepath,
96663
+ message: "could not merge: " + JSON.stringify(targets, null, 4),
96664
+ description: e22.message
96665
+ });
96666
+ }
96667
+ }
96668
+ async function parseJS(str, config4) {
96669
+ const defaultConfig = {
96670
+ plugins: ["typescript"],
96671
+ sourceType: "module"
96672
+ };
96632
96673
  return {
96633
96674
  start: 0,
96634
- script: (0, import_parser.parse)(str || "", {
96635
- plugins: ["typescript"],
96636
- sourceType: "module"
96637
- }).program,
96675
+ script: (0, import_parser.parse)(
96676
+ str || "",
96677
+ config4 ? deepMerge("", defaultConfig, config4) : defaultConfig
96678
+ ).program,
96638
96679
  end: str.length
96639
96680
  };
96640
96681
  }
96641
96682
  var recast = __toESM2(require_main2(), 1);
96642
96683
  var AST = recast.types.builders;
96643
- var import_deepmerge = __toESM2(require_cjs(), 1);
96644
96684
  var WalkerBase = class {
96645
96685
  constructor() {
96646
96686
  this.should_skip = false;
@@ -130944,7 +130984,7 @@ var require_visitor2 = __commonJS3({
130944
130984
  Object.defineProperty(exports, "__esModule", {
130945
130985
  value: true
130946
130986
  });
130947
- exports.visit = visit13;
130987
+ exports.visit = visit14;
130948
130988
  exports.visitInParallel = visitInParallel;
130949
130989
  exports.getVisitFn = getVisitFn;
130950
130990
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -131007,7 +131047,7 @@ var require_visitor2 = __commonJS3({
131007
131047
  exports.QueryDocumentKeys = QueryDocumentKeys;
131008
131048
  var BREAK = Object.freeze({});
131009
131049
  exports.BREAK = BREAK;
131010
- function visit13(root, visitor) {
131050
+ function visit14(root, visitor) {
131011
131051
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
131012
131052
  var stack = void 0;
131013
131053
  var inArray = Array.isArray(root);
@@ -169478,6 +169518,107 @@ var require_lib32 = __commonJS3({
169478
169518
  exports.tokTypes = tokTypes;
169479
169519
  }
169480
169520
  });
169521
+ var require_cjs2 = __commonJS3({
169522
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
169523
+ "use strict";
169524
+ var isMergeableObject = function isMergeableObject2(value2) {
169525
+ return isNonNullObject(value2) && !isSpecial(value2);
169526
+ };
169527
+ function isNonNullObject(value2) {
169528
+ return !!value2 && typeof value2 === "object";
169529
+ }
169530
+ function isSpecial(value2) {
169531
+ var stringValue = Object.prototype.toString.call(value2);
169532
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
169533
+ }
169534
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
169535
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
169536
+ function isReactElement(value2) {
169537
+ return value2.$$typeof === REACT_ELEMENT_TYPE;
169538
+ }
169539
+ function emptyTarget(val) {
169540
+ return Array.isArray(val) ? [] : {};
169541
+ }
169542
+ function cloneUnlessOtherwiseSpecified(value2, options) {
169543
+ return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
169544
+ }
169545
+ function defaultArrayMerge(target, source, options) {
169546
+ return target.concat(source).map(function(element) {
169547
+ return cloneUnlessOtherwiseSpecified(element, options);
169548
+ });
169549
+ }
169550
+ function getMergeFunction(key, options) {
169551
+ if (!options.customMerge) {
169552
+ return deepmerge;
169553
+ }
169554
+ var customMerge = options.customMerge(key);
169555
+ return typeof customMerge === "function" ? customMerge : deepmerge;
169556
+ }
169557
+ function getEnumerableOwnPropertySymbols(target) {
169558
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
169559
+ return target.propertyIsEnumerable(symbol);
169560
+ }) : [];
169561
+ }
169562
+ function getKeys(target) {
169563
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
169564
+ }
169565
+ function propertyIsOnObject(object, property) {
169566
+ try {
169567
+ return property in object;
169568
+ } catch (_) {
169569
+ return false;
169570
+ }
169571
+ }
169572
+ function propertyIsUnsafe(target, key) {
169573
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
169574
+ }
169575
+ function mergeObject(target, source, options) {
169576
+ var destination = {};
169577
+ if (options.isMergeableObject(target)) {
169578
+ getKeys(target).forEach(function(key) {
169579
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
169580
+ });
169581
+ }
169582
+ getKeys(source).forEach(function(key) {
169583
+ if (propertyIsUnsafe(target, key)) {
169584
+ return;
169585
+ }
169586
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
169587
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
169588
+ } else {
169589
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
169590
+ }
169591
+ });
169592
+ return destination;
169593
+ }
169594
+ function deepmerge(target, source, options) {
169595
+ options = options || {};
169596
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
169597
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
169598
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
169599
+ var sourceIsArray = Array.isArray(source);
169600
+ var targetIsArray = Array.isArray(target);
169601
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
169602
+ if (!sourceAndTargetTypesMatch) {
169603
+ return cloneUnlessOtherwiseSpecified(source, options);
169604
+ } else if (sourceIsArray) {
169605
+ return options.arrayMerge(target, source, options);
169606
+ } else {
169607
+ return mergeObject(target, source, options);
169608
+ }
169609
+ }
169610
+ deepmerge.all = function deepmergeAll(array, options) {
169611
+ if (!Array.isArray(array)) {
169612
+ throw new Error("first argument should be an array");
169613
+ }
169614
+ return array.reduce(function(prev, next) {
169615
+ return deepmerge(prev, next, options);
169616
+ }, {});
169617
+ };
169618
+ var deepmerge_1 = deepmerge;
169619
+ module2.exports = deepmerge_1;
169620
+ }
169621
+ });
169481
169622
  var require_tslib3 = __commonJS3({
169482
169623
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module2) {
169483
169624
  var __extends;
@@ -171734,7 +171875,7 @@ var require_path_visitor3 = __commonJS3({
171734
171875
  }
171735
171876
  return target;
171736
171877
  }
171737
- PathVisitor.visit = function visit13(node2, methods) {
171878
+ PathVisitor.visit = function visit14(node2, methods) {
171738
171879
  return PathVisitor.fromMethodsObject(methods).visit(node2);
171739
171880
  };
171740
171881
  var PVp = PathVisitor.prototype;
@@ -171925,7 +172066,7 @@ var require_path_visitor3 = __commonJS3({
171925
172066
  this.needToCallTraverse = false;
171926
172067
  return visitChildren(path22, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
171927
172068
  };
171928
- sharedContextProtoMethods.visit = function visit13(path22, newVisitor) {
172069
+ sharedContextProtoMethods.visit = function visit14(path22, newVisitor) {
171929
172070
  if (!(this instanceof this.Context)) {
171930
172071
  throw new Error("");
171931
172072
  }
@@ -173268,7 +173409,7 @@ var require_main5 = __commonJS3({
173268
173409
  var someField = _a.someField;
173269
173410
  var Type = _a.Type;
173270
173411
  var use = _a.use;
173271
- var visit13 = _a.visit;
173412
+ var visit14 = _a.visit;
173272
173413
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
173273
173414
  exports.builders = builders;
173274
173415
  exports.builtInTypes = builtInTypes;
@@ -173285,7 +173426,7 @@ var require_main5 = __commonJS3({
173285
173426
  exports.someField = someField;
173286
173427
  exports.Type = Type;
173287
173428
  exports.use = use;
173288
- exports.visit = visit13;
173429
+ exports.visit = visit14;
173289
173430
  Object.assign(namedTypes_1.namedTypes, n);
173290
173431
  }
173291
173432
  });
@@ -185700,107 +185841,6 @@ var require_main22 = __commonJS3({
185700
185841
  }
185701
185842
  }
185702
185843
  });
185703
- var require_cjs2 = __commonJS3({
185704
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
185705
- "use strict";
185706
- var isMergeableObject = function isMergeableObject2(value2) {
185707
- return isNonNullObject(value2) && !isSpecial(value2);
185708
- };
185709
- function isNonNullObject(value2) {
185710
- return !!value2 && typeof value2 === "object";
185711
- }
185712
- function isSpecial(value2) {
185713
- var stringValue = Object.prototype.toString.call(value2);
185714
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value2);
185715
- }
185716
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
185717
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
185718
- function isReactElement(value2) {
185719
- return value2.$$typeof === REACT_ELEMENT_TYPE;
185720
- }
185721
- function emptyTarget(val) {
185722
- return Array.isArray(val) ? [] : {};
185723
- }
185724
- function cloneUnlessOtherwiseSpecified(value2, options) {
185725
- return options.clone !== false && options.isMergeableObject(value2) ? deepmerge(emptyTarget(value2), value2, options) : value2;
185726
- }
185727
- function defaultArrayMerge(target, source, options) {
185728
- return target.concat(source).map(function(element) {
185729
- return cloneUnlessOtherwiseSpecified(element, options);
185730
- });
185731
- }
185732
- function getMergeFunction(key, options) {
185733
- if (!options.customMerge) {
185734
- return deepmerge;
185735
- }
185736
- var customMerge = options.customMerge(key);
185737
- return typeof customMerge === "function" ? customMerge : deepmerge;
185738
- }
185739
- function getEnumerableOwnPropertySymbols(target) {
185740
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
185741
- return target.propertyIsEnumerable(symbol);
185742
- }) : [];
185743
- }
185744
- function getKeys(target) {
185745
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
185746
- }
185747
- function propertyIsOnObject(object, property) {
185748
- try {
185749
- return property in object;
185750
- } catch (_) {
185751
- return false;
185752
- }
185753
- }
185754
- function propertyIsUnsafe(target, key) {
185755
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
185756
- }
185757
- function mergeObject(target, source, options) {
185758
- var destination = {};
185759
- if (options.isMergeableObject(target)) {
185760
- getKeys(target).forEach(function(key) {
185761
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
185762
- });
185763
- }
185764
- getKeys(source).forEach(function(key) {
185765
- if (propertyIsUnsafe(target, key)) {
185766
- return;
185767
- }
185768
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
185769
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
185770
- } else {
185771
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
185772
- }
185773
- });
185774
- return destination;
185775
- }
185776
- function deepmerge(target, source, options) {
185777
- options = options || {};
185778
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
185779
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
185780
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
185781
- var sourceIsArray = Array.isArray(source);
185782
- var targetIsArray = Array.isArray(target);
185783
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
185784
- if (!sourceAndTargetTypesMatch) {
185785
- return cloneUnlessOtherwiseSpecified(source, options);
185786
- } else if (sourceIsArray) {
185787
- return options.arrayMerge(target, source, options);
185788
- } else {
185789
- return mergeObject(target, source, options);
185790
- }
185791
- }
185792
- deepmerge.all = function deepmergeAll(array, options) {
185793
- if (!Array.isArray(array)) {
185794
- throw new Error("first argument should be an array");
185795
- }
185796
- return array.reduce(function(prev, next) {
185797
- return deepmerge(prev, next, options);
185798
- }, {});
185799
- };
185800
- var deepmerge_1 = deepmerge;
185801
- module2.exports = deepmerge_1;
185802
- }
185803
- });
185804
185844
  var import_minimatch2 = __toESM3(require_minimatch2(), 1);
185805
185845
  var config3 = {
185806
185846
  reset: {
@@ -189254,10 +189294,11 @@ var query2 = documentPlugin2(ArtifactKind2.Query, function() {
189254
189294
  cache_default2.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
189255
189295
  }
189256
189296
  lastVariables = { ...marshalVariables(ctx) };
189297
+ const variables = lastVariables;
189257
189298
  subscriptionSpec = {
189258
189299
  rootType: ctx.artifact.rootType,
189259
189300
  selection: ctx.artifact.selection,
189260
- variables: () => lastVariables,
189301
+ variables: () => variables,
189261
189302
  set: (newValue) => {
189262
189303
  resolve22(ctx, {
189263
189304
  data: newValue,
@@ -189284,12 +189325,17 @@ var query2 = documentPlugin2(ArtifactKind2.Query, function() {
189284
189325
  });
189285
189326
  var fragment3 = documentPlugin2(ArtifactKind2.Fragment, function() {
189286
189327
  let subscriptionSpec = null;
189328
+ let lastReference = null;
189287
189329
  return {
189288
189330
  start(ctx, { next, resolve: resolve22, variablesChanged, marshalVariables }) {
189289
189331
  if (!ctx.stuff.parentID) {
189290
189332
  return next(ctx);
189291
189333
  }
189292
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
189334
+ const currentReference = {
189335
+ parent: ctx.stuff.parentID,
189336
+ variables: marshalVariables(ctx)
189337
+ };
189338
+ if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals2(lastReference, currentReference) || variablesChanged(ctx))) {
189293
189339
  if (subscriptionSpec) {
189294
189340
  cache_default2.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
189295
189341
  }
@@ -189312,6 +189358,7 @@ var fragment3 = documentPlugin2(ArtifactKind2.Fragment, function() {
189312
189358
  }
189313
189359
  };
189314
189360
  cache_default2.subscribe(subscriptionSpec, variables);
189361
+ lastReference = currentReference;
189315
189362
  }
189316
189363
  next(ctx);
189317
189364
  },
@@ -189377,9 +189424,9 @@ var emptySchema2 = graphql22.buildSchema("type Query { hello: String }");
189377
189424
  var defaultDirectives2 = emptySchema2.getDirectives().map((dir) => dir.name);
189378
189425
  var graphql32 = __toESM3(require_graphql22(), 1);
189379
189426
  var import_parser2 = __toESM3(require_lib32(), 1);
189427
+ var import_deepmerge2 = __toESM3(require_cjs2(), 1);
189380
189428
  var recast2 = __toESM3(require_main22(), 1);
189381
189429
  var AST2 = recast2.types.builders;
189382
- var import_deepmerge2 = __toESM3(require_cjs2(), 1);
189383
189430
  var graphql42 = __toESM3(require_graphql22(), 1);
189384
189431
  var graphql14 = __toESM3(require_graphql22(), 1);
189385
189432
  var recast5 = __toESM3(require_main22(), 1);