houdini 1.1.4-react.0 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/build/cmd-cjs/index.js +607 -444
  2. package/build/cmd-esm/index.js +607 -444
  3. package/build/codegen/transforms/fragmentVariables.d.ts +0 -11
  4. package/build/codegen-cjs/index.js +577 -403
  5. package/build/codegen-esm/index.js +577 -403
  6. package/build/lib/config.d.ts +1 -1
  7. package/build/lib/parse.d.ts +1 -2
  8. package/build/lib/types.d.ts +1 -4
  9. package/build/lib-cjs/index.js +187 -195
  10. package/build/lib-esm/index.js +187 -195
  11. package/build/runtime/cache/cache.d.ts +4 -2
  12. package/build/runtime/client/documentStore.d.ts +0 -3
  13. package/build/runtime/client/index.d.ts +1 -1
  14. package/build/runtime/lib/types.d.ts +4 -46
  15. package/build/runtime-cjs/cache/cache.d.ts +4 -2
  16. package/build/runtime-cjs/cache/cache.js +37 -14
  17. package/build/runtime-cjs/client/documentStore.d.ts +0 -3
  18. package/build/runtime-cjs/client/documentStore.js +6 -11
  19. package/build/runtime-cjs/client/index.d.ts +1 -1
  20. package/build/runtime-cjs/client/plugins/cache.js +3 -5
  21. package/build/runtime-cjs/client/plugins/fragment.js +1 -8
  22. package/build/runtime-cjs/client/plugins/query.js +1 -2
  23. package/build/runtime-cjs/lib/types.d.ts +4 -46
  24. package/build/runtime-esm/cache/cache.d.ts +4 -2
  25. package/build/runtime-esm/cache/cache.js +37 -14
  26. package/build/runtime-esm/client/documentStore.d.ts +0 -3
  27. package/build/runtime-esm/client/documentStore.js +6 -11
  28. package/build/runtime-esm/client/index.d.ts +1 -1
  29. package/build/runtime-esm/client/plugins/cache.js +3 -5
  30. package/build/runtime-esm/client/plugins/fragment.js +1 -8
  31. package/build/runtime-esm/client/plugins/query.js +1 -2
  32. package/build/runtime-esm/lib/types.d.ts +4 -46
  33. package/build/test-cjs/index.js +598 -428
  34. package/build/test-esm/index.js +598 -428
  35. package/build/vite-cjs/index.js +617 -454
  36. package/build/vite-esm/index.js +617 -454
  37. package/package.json +3 -1
  38. package/build/runtime/lib/pageInfo.d.ts +0 -7
  39. package/build/runtime/lib/pagination.d.ts +0 -29
  40. package/build/runtime-cjs/lib/pageInfo.d.ts +0 -7
  41. package/build/runtime-cjs/lib/pageInfo.js +0 -79
  42. package/build/runtime-cjs/lib/pagination.d.ts +0 -29
  43. package/build/runtime-cjs/lib/pagination.js +0 -231
  44. package/build/runtime-esm/lib/pageInfo.d.ts +0 -7
  45. package/build/runtime-esm/lib/pageInfo.js +0 -52
  46. package/build/runtime-esm/lib/pagination.d.ts +0 -29
  47. package/build/runtime-esm/lib/pagination.js +0 -206
@@ -2406,7 +2406,7 @@ var require_visitor = __commonJS({
2406
2406
  Object.defineProperty(exports, "__esModule", {
2407
2407
  value: true
2408
2408
  });
2409
- exports.visit = visit3;
2409
+ exports.visit = visit2;
2410
2410
  exports.visitInParallel = visitInParallel;
2411
2411
  exports.getVisitFn = getVisitFn;
2412
2412
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -2469,7 +2469,7 @@ var require_visitor = __commonJS({
2469
2469
  exports.QueryDocumentKeys = QueryDocumentKeys;
2470
2470
  var BREAK = Object.freeze({});
2471
2471
  exports.BREAK = BREAK;
2472
- function visit3(root, visitor) {
2472
+ function visit2(root, visitor) {
2473
2473
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
2474
2474
  var stack = void 0;
2475
2475
  var inArray = Array.isArray(root);
@@ -42024,109 +42024,6 @@ var require_lib3 = __commonJS({
42024
42024
  }
42025
42025
  });
42026
42026
 
42027
- // ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
42028
- var require_cjs = __commonJS({
42029
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
42030
- "use strict";
42031
- var isMergeableObject = function isMergeableObject2(value) {
42032
- return isNonNullObject(value) && !isSpecial(value);
42033
- };
42034
- function isNonNullObject(value) {
42035
- return !!value && typeof value === "object";
42036
- }
42037
- function isSpecial(value) {
42038
- var stringValue = Object.prototype.toString.call(value);
42039
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
42040
- }
42041
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
42042
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
42043
- function isReactElement(value) {
42044
- return value.$$typeof === REACT_ELEMENT_TYPE;
42045
- }
42046
- function emptyTarget(val) {
42047
- return Array.isArray(val) ? [] : {};
42048
- }
42049
- function cloneUnlessOtherwiseSpecified(value, options) {
42050
- return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
42051
- }
42052
- function defaultArrayMerge(target, source, options) {
42053
- return target.concat(source).map(function(element) {
42054
- return cloneUnlessOtherwiseSpecified(element, options);
42055
- });
42056
- }
42057
- function getMergeFunction(key, options) {
42058
- if (!options.customMerge) {
42059
- return deepmerge;
42060
- }
42061
- var customMerge = options.customMerge(key);
42062
- return typeof customMerge === "function" ? customMerge : deepmerge;
42063
- }
42064
- function getEnumerableOwnPropertySymbols(target) {
42065
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
42066
- return target.propertyIsEnumerable(symbol);
42067
- }) : [];
42068
- }
42069
- function getKeys(target) {
42070
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
42071
- }
42072
- function propertyIsOnObject(object, property) {
42073
- try {
42074
- return property in object;
42075
- } catch (_) {
42076
- return false;
42077
- }
42078
- }
42079
- function propertyIsUnsafe(target, key) {
42080
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
42081
- }
42082
- function mergeObject(target, source, options) {
42083
- var destination = {};
42084
- if (options.isMergeableObject(target)) {
42085
- getKeys(target).forEach(function(key) {
42086
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
42087
- });
42088
- }
42089
- getKeys(source).forEach(function(key) {
42090
- if (propertyIsUnsafe(target, key)) {
42091
- return;
42092
- }
42093
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
42094
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
42095
- } else {
42096
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
42097
- }
42098
- });
42099
- return destination;
42100
- }
42101
- function deepmerge(target, source, options) {
42102
- options = options || {};
42103
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
42104
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
42105
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
42106
- var sourceIsArray = Array.isArray(source);
42107
- var targetIsArray = Array.isArray(target);
42108
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
42109
- if (!sourceAndTargetTypesMatch) {
42110
- return cloneUnlessOtherwiseSpecified(source, options);
42111
- } else if (sourceIsArray) {
42112
- return options.arrayMerge(target, source, options);
42113
- } else {
42114
- return mergeObject(target, source, options);
42115
- }
42116
- }
42117
- deepmerge.all = function deepmergeAll(array, options) {
42118
- if (!Array.isArray(array)) {
42119
- throw new Error("first argument should be an array");
42120
- }
42121
- return array.reduce(function(prev, next) {
42122
- return deepmerge(prev, next, options);
42123
- }, {});
42124
- };
42125
- var deepmerge_1 = deepmerge;
42126
- module.exports = deepmerge_1;
42127
- }
42128
- });
42129
-
42130
42027
  // ../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js
42131
42028
  var require_tslib = __commonJS({
42132
42029
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module) {
@@ -44396,7 +44293,7 @@ var require_path_visitor = __commonJS({
44396
44293
  }
44397
44294
  return target;
44398
44295
  }
44399
- PathVisitor.visit = function visit3(node, methods) {
44296
+ PathVisitor.visit = function visit2(node, methods) {
44400
44297
  return PathVisitor.fromMethodsObject(methods).visit(node);
44401
44298
  };
44402
44299
  var PVp = PathVisitor.prototype;
@@ -44587,7 +44484,7 @@ var require_path_visitor = __commonJS({
44587
44484
  this.needToCallTraverse = false;
44588
44485
  return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
44589
44486
  };
44590
- sharedContextProtoMethods.visit = function visit3(path2, newVisitor) {
44487
+ sharedContextProtoMethods.visit = function visit2(path2, newVisitor) {
44591
44488
  if (!(this instanceof this.Context)) {
44592
44489
  throw new Error("");
44593
44490
  }
@@ -45980,7 +45877,7 @@ var require_main = __commonJS({
45980
45877
  var someField = _a.someField;
45981
45878
  var Type = _a.Type;
45982
45879
  var use = _a.use;
45983
- var visit3 = _a.visit;
45880
+ var visit2 = _a.visit;
45984
45881
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
45985
45882
  exports.builders = builders;
45986
45883
  exports.builtInTypes = builtInTypes;
@@ -45997,7 +45894,7 @@ var require_main = __commonJS({
45997
45894
  exports.someField = someField;
45998
45895
  exports.Type = Type;
45999
45896
  exports.use = use;
46000
- exports.visit = visit3;
45897
+ exports.visit = visit2;
46001
45898
  Object.assign(namedTypes_1.namedTypes, n);
46002
45899
  }
46003
45900
  });
@@ -58459,6 +58356,109 @@ var require_main2 = __commonJS({
58459
58356
  }
58460
58357
  });
58461
58358
 
58359
+ // ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
58360
+ var require_cjs = __commonJS({
58361
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
58362
+ "use strict";
58363
+ var isMergeableObject = function isMergeableObject2(value) {
58364
+ return isNonNullObject(value) && !isSpecial(value);
58365
+ };
58366
+ function isNonNullObject(value) {
58367
+ return !!value && typeof value === "object";
58368
+ }
58369
+ function isSpecial(value) {
58370
+ var stringValue = Object.prototype.toString.call(value);
58371
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
58372
+ }
58373
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
58374
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
58375
+ function isReactElement(value) {
58376
+ return value.$$typeof === REACT_ELEMENT_TYPE;
58377
+ }
58378
+ function emptyTarget(val) {
58379
+ return Array.isArray(val) ? [] : {};
58380
+ }
58381
+ function cloneUnlessOtherwiseSpecified(value, options) {
58382
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
58383
+ }
58384
+ function defaultArrayMerge(target, source, options) {
58385
+ return target.concat(source).map(function(element) {
58386
+ return cloneUnlessOtherwiseSpecified(element, options);
58387
+ });
58388
+ }
58389
+ function getMergeFunction(key, options) {
58390
+ if (!options.customMerge) {
58391
+ return deepmerge;
58392
+ }
58393
+ var customMerge = options.customMerge(key);
58394
+ return typeof customMerge === "function" ? customMerge : deepmerge;
58395
+ }
58396
+ function getEnumerableOwnPropertySymbols(target) {
58397
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
58398
+ return target.propertyIsEnumerable(symbol);
58399
+ }) : [];
58400
+ }
58401
+ function getKeys(target) {
58402
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
58403
+ }
58404
+ function propertyIsOnObject(object, property) {
58405
+ try {
58406
+ return property in object;
58407
+ } catch (_) {
58408
+ return false;
58409
+ }
58410
+ }
58411
+ function propertyIsUnsafe(target, key) {
58412
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
58413
+ }
58414
+ function mergeObject(target, source, options) {
58415
+ var destination = {};
58416
+ if (options.isMergeableObject(target)) {
58417
+ getKeys(target).forEach(function(key) {
58418
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
58419
+ });
58420
+ }
58421
+ getKeys(source).forEach(function(key) {
58422
+ if (propertyIsUnsafe(target, key)) {
58423
+ return;
58424
+ }
58425
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
58426
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
58427
+ } else {
58428
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
58429
+ }
58430
+ });
58431
+ return destination;
58432
+ }
58433
+ function deepmerge(target, source, options) {
58434
+ options = options || {};
58435
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
58436
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
58437
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
58438
+ var sourceIsArray = Array.isArray(source);
58439
+ var targetIsArray = Array.isArray(target);
58440
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
58441
+ if (!sourceAndTargetTypesMatch) {
58442
+ return cloneUnlessOtherwiseSpecified(source, options);
58443
+ } else if (sourceIsArray) {
58444
+ return options.arrayMerge(target, source, options);
58445
+ } else {
58446
+ return mergeObject(target, source, options);
58447
+ }
58448
+ }
58449
+ deepmerge.all = function deepmergeAll(array, options) {
58450
+ if (!Array.isArray(array)) {
58451
+ throw new Error("first argument should be an array");
58452
+ }
58453
+ return array.reduce(function(prev, next) {
58454
+ return deepmerge(prev, next, options);
58455
+ }, {});
58456
+ };
58457
+ var deepmerge_1 = deepmerge;
58458
+ module.exports = deepmerge_1;
58459
+ }
58460
+ });
58461
+
58462
58462
  // src/lib/pipeline.ts
58463
58463
  async function runPipeline(config, pipeline2, target) {
58464
58464
  for (const transform of pipeline2) {
@@ -65221,7 +65221,8 @@ var CacheInternal = class {
65221
65221
  parent = rootID,
65222
65222
  variables,
65223
65223
  stepsFromConnection = null,
65224
- ignoreMasking
65224
+ ignoreMasking,
65225
+ fullCheck = false
65225
65226
  }) {
65226
65227
  if (parent === null) {
65227
65228
  return { data: null, partial: false, stale: false, hasData: true };
@@ -65246,11 +65247,28 @@ var CacheInternal = class {
65246
65247
  let targetSelection = getFieldsForType(selection, typename);
65247
65248
  for (const [
65248
65249
  attributeName,
65249
- { type, keyRaw, selection: fieldSelection, nullable, list, visible }
65250
+ { type, keyRaw, selection: fieldSelection, nullable, list, visible, directives }
65250
65251
  ] of Object.entries(targetSelection)) {
65251
- if (!visible && !ignoreMasking) {
65252
+ if (!visible && !ignoreMasking && !fullCheck) {
65252
65253
  continue;
65253
65254
  }
65255
+ const includeDirective = directives?.find((d) => {
65256
+ return d.name === "include";
65257
+ });
65258
+ if (includeDirective) {
65259
+ if (!evaluateFragmentVariables(includeDirective.arguments, variables ?? {})["if"]) {
65260
+ continue;
65261
+ }
65262
+ }
65263
+ const skipDirective = directives?.find((d) => {
65264
+ return d.name === "skip";
65265
+ });
65266
+ if (skipDirective) {
65267
+ if (evaluateFragmentVariables(skipDirective.arguments, variables ?? {})["if"]) {
65268
+ continue;
65269
+ }
65270
+ }
65271
+ const fieldTarget = visible || ignoreMasking ? target : {};
65254
65272
  const key = evaluateKey(keyRaw, variables);
65255
65273
  const { value } = this.storage.get(parent, key);
65256
65274
  const dt_field = this.staleManager.getFieldTime(parent, key);
@@ -65273,16 +65291,16 @@ var CacheInternal = class {
65273
65291
  partial = true;
65274
65292
  }
65275
65293
  if (typeof value === "undefined" || value === null) {
65276
- target[attributeName] = null;
65294
+ fieldTarget[attributeName] = null;
65277
65295
  if (typeof value !== "undefined") {
65278
65296
  hasData = true;
65279
65297
  }
65280
65298
  } else if (!fieldSelection) {
65281
65299
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
65282
65300
  if (fnUnmarshal) {
65283
- target[attributeName] = fnUnmarshal(value);
65301
+ fieldTarget[attributeName] = fnUnmarshal(value);
65284
65302
  } else {
65285
- target[attributeName] = value;
65303
+ fieldTarget[attributeName] = value;
65286
65304
  }
65287
65305
  hasData = true;
65288
65306
  } else if (Array.isArray(value)) {
@@ -65291,9 +65309,10 @@ var CacheInternal = class {
65291
65309
  variables,
65292
65310
  linkedList: value,
65293
65311
  stepsFromConnection: nextStep,
65294
- ignoreMasking: !!ignoreMasking
65312
+ ignoreMasking: !!ignoreMasking,
65313
+ fullCheck
65295
65314
  });
65296
- target[attributeName] = listValue.data;
65315
+ fieldTarget[attributeName] = listValue.data;
65297
65316
  if (listValue.partial) {
65298
65317
  partial = true;
65299
65318
  }
@@ -65309,9 +65328,10 @@ var CacheInternal = class {
65309
65328
  selection: fieldSelection,
65310
65329
  variables,
65311
65330
  stepsFromConnection: nextStep,
65312
- ignoreMasking
65331
+ ignoreMasking,
65332
+ fullCheck
65313
65333
  });
65314
- target[attributeName] = objectFields.data;
65334
+ fieldTarget[attributeName] = objectFields.data;
65315
65335
  if (objectFields.partial) {
65316
65336
  partial = true;
65317
65337
  }
@@ -65322,7 +65342,7 @@ var CacheInternal = class {
65322
65342
  hasData = true;
65323
65343
  }
65324
65344
  }
65325
- if (target[attributeName] === null && !nullable && !embeddedCursor) {
65345
+ if (fieldTarget[attributeName] === null && !nullable && !embeddedCursor) {
65326
65346
  cascadeNull = true;
65327
65347
  }
65328
65348
  }
@@ -65354,7 +65374,8 @@ var CacheInternal = class {
65354
65374
  variables,
65355
65375
  linkedList,
65356
65376
  stepsFromConnection,
65357
- ignoreMasking
65377
+ ignoreMasking,
65378
+ fullCheck
65358
65379
  }) {
65359
65380
  const result = [];
65360
65381
  let partialData = false;
@@ -65367,7 +65388,8 @@ var CacheInternal = class {
65367
65388
  variables,
65368
65389
  linkedList: entry,
65369
65390
  stepsFromConnection,
65370
- ignoreMasking
65391
+ ignoreMasking,
65392
+ fullCheck
65371
65393
  });
65372
65394
  result.push(nestedValue.data);
65373
65395
  if (nestedValue.partial) {
@@ -65389,7 +65411,8 @@ var CacheInternal = class {
65389
65411
  selection: fields,
65390
65412
  variables,
65391
65413
  stepsFromConnection,
65392
- ignoreMasking
65414
+ ignoreMasking,
65415
+ fullCheck
65393
65416
  });
65394
65417
  result.push(data);
65395
65418
  if (partial) {
@@ -65548,12 +65571,12 @@ var cachePolicy = ({
65548
65571
  network(ctx, { initialValue, next, resolve: resolve2, marshalVariables: marshalVariables2 }) {
65549
65572
  const { policy, artifact } = ctx;
65550
65573
  let useCache = false;
65551
- if (enabled && (artifact.kind === ArtifactKind.Query || artifact.kind === ArtifactKind.Fragment) && !ctx.cacheParams?.disableRead) {
65574
+ if (enabled && artifact.kind === ArtifactKind.Query && !ctx.cacheParams?.disableRead) {
65552
65575
  if (policy !== CachePolicy.NetworkOnly) {
65553
65576
  const value = localCache.read({
65554
65577
  selection: artifact.selection,
65555
65578
  variables: marshalVariables2(ctx),
65556
- parent: ctx.stuff?.parentID
65579
+ fullCheck: true
65557
65580
  });
65558
65581
  const allowed = !value.partial || artifact.kind === ArtifactKind.Query && artifact.partial;
65559
65582
  if (policy === CachePolicy.CacheOnly) {
@@ -65589,9 +65612,7 @@ var cachePolicy = ({
65589
65612
  localCache._internal_unstable.collectGarbage();
65590
65613
  }, 0);
65591
65614
  }
65592
- if (!ctx.stuff?.silenceLoading) {
65593
- setFetching(!useCache);
65594
- }
65615
+ setFetching(!useCache);
65595
65616
  return next(ctx);
65596
65617
  },
65597
65618
  afterNetwork(ctx, { resolve: resolve2, value, marshalVariables: marshalVariables2 }) {
@@ -65671,11 +65692,10 @@ var query = documentPlugin(ArtifactKind.Query, function() {
65671
65692
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
65672
65693
  }
65673
65694
  lastVariables = { ...marshalVariables2(ctx) };
65674
- const variables = lastVariables;
65675
65695
  subscriptionSpec = {
65676
65696
  rootType: ctx.artifact.rootType,
65677
65697
  selection: ctx.artifact.selection,
65678
- variables: () => variables,
65698
+ variables: () => lastVariables,
65679
65699
  set: (newValue) => {
65680
65700
  resolve2(ctx, {
65681
65701
  data: newValue,
@@ -65704,17 +65724,12 @@ var query = documentPlugin(ArtifactKind.Query, function() {
65704
65724
  // src/runtime/client/plugins/fragment.ts
65705
65725
  var fragment = documentPlugin(ArtifactKind.Fragment, function() {
65706
65726
  let subscriptionSpec = null;
65707
- let lastReference = null;
65708
65727
  return {
65709
65728
  start(ctx, { next, resolve: resolve2, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
65710
65729
  if (!ctx.stuff.parentID) {
65711
65730
  return next(ctx);
65712
65731
  }
65713
- const currentReference = {
65714
- parent: ctx.stuff.parentID,
65715
- variables: marshalVariables2(ctx)
65716
- };
65717
- if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
65732
+ if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
65718
65733
  if (subscriptionSpec) {
65719
65734
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
65720
65735
  }
@@ -65737,7 +65752,6 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
65737
65752
  }
65738
65753
  };
65739
65754
  cache_default.subscribe(subscriptionSpec, variables);
65740
- lastReference = currentReference;
65741
65755
  }
65742
65756
  next(ctx);
65743
65757
  },
@@ -65938,7 +65952,6 @@ var DocumentStore = class extends Writable {
65938
65952
  #plugins;
65939
65953
  #lastVariables;
65940
65954
  #lastContext = null;
65941
- pendingPromise = null;
65942
65955
  constructor({
65943
65956
  artifact,
65944
65957
  plugins: plugins2,
@@ -66011,7 +66024,7 @@ var DocumentStore = class extends Writable {
66011
66024
  const draft = context.draft();
66012
66025
  draft.variables = variables ?? null;
66013
66026
  context = context.apply(draft, false);
66014
- const promise = new Promise((resolve2, reject) => {
66027
+ return await new Promise((resolve2, reject) => {
66015
66028
  const state = {
66016
66029
  setup,
66017
66030
  currentStep: 0,
@@ -66020,17 +66033,12 @@ var DocumentStore = class extends Writable {
66020
66033
  promise: {
66021
66034
  resolved: false,
66022
66035
  resolve: resolve2,
66023
- reject,
66024
- then: (...args) => promise.then(...args)
66036
+ reject
66025
66037
  },
66026
66038
  context
66027
66039
  };
66028
- if (this.pendingPromise === null) {
66029
- this.pendingPromise = state.promise;
66030
- }
66031
66040
  this.#step("forward", state);
66032
66041
  });
66033
- return await promise;
66034
66042
  }
66035
66043
  async cleanup() {
66036
66044
  for (const plugin2 of this.#plugins) {
@@ -66149,15 +66157,16 @@ var DocumentStore = class extends Writable {
66149
66157
  value
66150
66158
  );
66151
66159
  }
66152
- if (!ctx.silenceEcho || value.data !== this.state.data) {
66153
- this.set(value);
66154
- }
66155
66160
  if (!ctx.promise.resolved) {
66156
66161
  ctx.promise.resolve(value);
66157
66162
  ctx.promise.resolved = true;
66158
66163
  }
66159
66164
  this.#lastContext = ctx.context.draft();
66160
66165
  this.#lastVariables = this.#lastContext.stuff.inputs.marshaled;
66166
+ if (ctx.silenceEcho && value.data === this.state.data) {
66167
+ return;
66168
+ }
66169
+ this.set(value);
66161
66170
  }
66162
66171
  };
66163
66172
  var ClientPluginContextWrapper = class {
@@ -66775,17 +66784,6 @@ var Config = class {
66775
66784
  }, []) ?? [];
66776
66785
  return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
66777
66786
  }
66778
- needsRefetchArtifact(document) {
66779
- let needsArtifact = false;
66780
- graphql2.visit(document, {
66781
- Directive: (node) => {
66782
- if ([this.paginateDirective].includes(node.name.value)) {
66783
- needsArtifact = true;
66784
- }
66785
- }
66786
- });
66787
- return needsArtifact;
66788
- }
66789
66787
  #fragmentVariableMaps;
66790
66788
  registerFragmentVariablesHash({
66791
66789
  hash,
@@ -66793,7 +66791,7 @@ var Config = class {
66793
66791
  fragment: fragment2
66794
66792
  }) {
66795
66793
  this.#fragmentVariableMaps[hash] = {
66796
- args: this.#serializeValueMap(args),
66794
+ args: this.serializeValueMap(args),
66797
66795
  fragment: fragment2
66798
66796
  };
66799
66797
  }
@@ -66804,7 +66802,7 @@ var Config = class {
66804
66802
  hash
66805
66803
  };
66806
66804
  }
66807
- #serializeValueMap(map) {
66805
+ serializeValueMap(map) {
66808
66806
  if (!map) {
66809
66807
  return null;
66810
66808
  }
@@ -66819,7 +66817,7 @@ var Config = class {
66819
66817
  }
66820
66818
  if ("values" in input) {
66821
66819
  result.values = input.values.map(
66822
- (value) => this.#serializeValueMap({ foo: value }).foo
66820
+ (value) => this.serializeValueMap({ foo: value }).foo
66823
66821
  );
66824
66822
  }
66825
66823
  if ("name" in input) {
@@ -66828,7 +66826,7 @@ var Config = class {
66828
66826
  if ("fields" in input) {
66829
66827
  result.fields = input.fields.map((field) => ({
66830
66828
  name: field.name,
66831
- value: this.#serializeValueMap({ foo: field.value }).foo
66829
+ value: this.serializeValueMap({ foo: field.value }).foo
66832
66830
  }));
66833
66831
  }
66834
66832
  }
@@ -67281,40 +67279,13 @@ var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
67281
67279
 
67282
67280
  // src/lib/parse.ts
67283
67281
  var import_parser = __toESM(require_lib3(), 1);
67284
-
67285
- // src/lib/deepMerge.ts
67286
- var import_deepmerge = __toESM(require_cjs(), 1);
67287
- function deepMerge(filepath, ...targets) {
67288
- try {
67289
- if (targets.length === 1) {
67290
- return targets[0];
67291
- } else if (targets.length === 2) {
67292
- return (0, import_deepmerge.default)(targets[0], targets[1], {
67293
- arrayMerge: (source, update) => [...new Set(source.concat(update))]
67294
- });
67295
- }
67296
- return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
67297
- } catch (e2) {
67298
- throw new HoudiniError({
67299
- filepath,
67300
- message: "could not merge: " + JSON.stringify(targets, null, 4),
67301
- description: e2.message
67302
- });
67303
- }
67304
- }
67305
-
67306
- // src/lib/parse.ts
67307
- async function parseJS(str, config) {
67308
- const defaultConfig = {
67309
- plugins: ["typescript"],
67310
- sourceType: "module"
67311
- };
67282
+ async function parseJS(str) {
67312
67283
  return {
67313
67284
  start: 0,
67314
- script: (0, import_parser.parse)(
67315
- str || "",
67316
- config ? deepMerge("", defaultConfig, config) : defaultConfig
67317
- ).program,
67285
+ script: (0, import_parser.parse)(str || "", {
67286
+ plugins: ["typescript"],
67287
+ sourceType: "module"
67288
+ }).program,
67318
67289
  end: str.length
67319
67290
  };
67320
67291
  }
@@ -67382,6 +67353,27 @@ async function cleanupFiles(pathFolder, listOfObj) {
67382
67353
  return allFilesNotInList;
67383
67354
  }
67384
67355
 
67356
+ // src/lib/deepMerge.ts
67357
+ var import_deepmerge = __toESM(require_cjs(), 1);
67358
+ function deepMerge(filepath, ...targets) {
67359
+ try {
67360
+ if (targets.length === 1) {
67361
+ return targets[0];
67362
+ } else if (targets.length === 2) {
67363
+ return (0, import_deepmerge.default)(targets[0], targets[1], {
67364
+ arrayMerge: (source, update) => [...new Set(source.concat(update))]
67365
+ });
67366
+ }
67367
+ return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
67368
+ } catch (e2) {
67369
+ throw new HoudiniError({
67370
+ filepath,
67371
+ message: "could not merge: " + targets,
67372
+ description: e2.message
67373
+ });
67374
+ }
67375
+ }
67376
+
67385
67377
  // src/lib/detectTools.ts
67386
67378
  async function detectFromPackageJSON(cwd) {
67387
67379
  try {
@@ -87,12 +87,13 @@ declare class CacheInternal {
87
87
  forceNotify?: boolean;
88
88
  forceStale?: boolean;
89
89
  }): FieldSelection[];
90
- getSelection({ selection, parent, variables, stepsFromConnection, ignoreMasking, }: {
90
+ getSelection({ selection, parent, variables, stepsFromConnection, ignoreMasking, fullCheck, }: {
91
91
  selection: SubscriptionSelection;
92
92
  parent?: string;
93
93
  variables?: {};
94
94
  stepsFromConnection?: number | null;
95
95
  ignoreMasking?: boolean;
96
+ fullCheck?: boolean;
96
97
  }): {
97
98
  data: GraphQLObject | null;
98
99
  partial: boolean;
@@ -103,12 +104,13 @@ declare class CacheInternal {
103
104
  id(type: string, id: string): string | null;
104
105
  idFields(type: string): string[];
105
106
  computeID(type: string, data: any): string;
106
- hydrateNestedList({ fields, variables, linkedList, stepsFromConnection, ignoreMasking, }: {
107
+ hydrateNestedList({ fields, variables, linkedList, stepsFromConnection, ignoreMasking, fullCheck, }: {
107
108
  fields: SubscriptionSelection;
108
109
  variables?: {};
109
110
  linkedList: NestedList;
110
111
  stepsFromConnection: number | null;
111
112
  ignoreMasking: boolean;
113
+ fullCheck?: boolean;
112
114
  }): {
113
115
  data: NestedList<GraphQLValue>;
114
116
  partial: boolean;
@@ -5,9 +5,6 @@ import { Writable } from '../lib/store';
5
5
  import type { DocumentArtifact, QueryResult, GraphQLObject, SubscriptionSpec, CachePolicies } from '../lib/types';
6
6
  export declare class DocumentStore<_Data extends GraphQLObject, _Input extends Record<string, any>> extends Writable<QueryResult<_Data, _Input>> {
7
7
  #private;
8
- pendingPromise: {
9
- then: (val: any) => void;
10
- } | null;
11
8
  constructor({ artifact, plugins, pipeline, client, cache, initialValue, fetching, }: {
12
9
  artifact: DocumentArtifact;
13
10
  plugins?: ClientHooks[];
@@ -3,7 +3,7 @@ import type { DocumentArtifact, GraphQLObject, NestedList } from '../lib/types';
3
3
  import type { ClientPlugin, ClientHooks } from './documentStore';
4
4
  import { DocumentStore } from './documentStore';
5
5
  import { type FetchParamFn, type ThrowOnErrorParams } from './plugins';
6
- export { DocumentStore, type ClientPlugin, type SendParams } from './documentStore';
6
+ export { DocumentStore, type ClientPlugin } from './documentStore';
7
7
  export { fetch, mutation, query, subscription } from './plugins';
8
8
  type ConstructorArgs = {
9
9
  url: string;