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
@@ -118,7 +118,6 @@ export declare class Config {
118
118
  listRemoveFragment(name: string): string;
119
119
  isInternalEnum(node: graphql.EnumTypeDefinitionNode): boolean;
120
120
  isInternalDirective(name: string): boolean;
121
- needsRefetchArtifact(document: graphql.DocumentNode): boolean;
122
121
  registerFragmentVariablesHash({ hash, args, fragment, }: {
123
122
  hash: string;
124
123
  args: ValueMap | null;
@@ -128,6 +127,7 @@ export declare class Config {
128
127
  args: ValueMap | null;
129
128
  fragment: string;
130
129
  };
130
+ serializeValueMap(map: ValueMap | null): ValueMap | null;
131
131
  isListFragment(name: string): boolean;
132
132
  isListOperationDirective(name: string): boolean;
133
133
  isFragmentForList(listName: string, fragmentName: string): boolean;
@@ -1,9 +1,8 @@
1
- import { type ParserOptions } from '@babel/parser';
2
1
  import type { Maybe, Script } from './types';
3
2
  export type ParsedFile = Maybe<{
4
3
  script: Script;
5
4
  start: number;
6
5
  end: number;
7
6
  }>;
8
- export declare function parseJS(str: string, config?: Partial<ParserOptions>): Promise<ParsedFile>;
7
+ export declare function parseJS(str: string): Promise<ParsedFile>;
9
8
  export declare function parseJSON(str: string): any;
@@ -103,10 +103,7 @@ export type PluginHooks = {
103
103
  transformRuntime?: Record<string, (args: {
104
104
  config: Config;
105
105
  content: string;
106
- }) => string> | ((docs: Document[]) => Record<string, (args: {
107
- config: Config;
108
- content: string;
109
- }) => string>);
106
+ }) => string>;
110
107
  /**
111
108
  * An module with an default export that sets configuration values.
112
109
  */
@@ -2401,7 +2401,7 @@ var require_visitor = __commonJS({
2401
2401
  Object.defineProperty(exports, "__esModule", {
2402
2402
  value: true
2403
2403
  });
2404
- exports.visit = visit3;
2404
+ exports.visit = visit2;
2405
2405
  exports.visitInParallel = visitInParallel;
2406
2406
  exports.getVisitFn = getVisitFn;
2407
2407
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -2464,7 +2464,7 @@ var require_visitor = __commonJS({
2464
2464
  exports.QueryDocumentKeys = QueryDocumentKeys;
2465
2465
  var BREAK = Object.freeze({});
2466
2466
  exports.BREAK = BREAK;
2467
- function visit3(root, visitor) {
2467
+ function visit2(root, visitor) {
2468
2468
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
2469
2469
  var stack = void 0;
2470
2470
  var inArray = Array.isArray(root);
@@ -42019,109 +42019,6 @@ var require_lib3 = __commonJS({
42019
42019
  }
42020
42020
  });
42021
42021
 
42022
- // ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
42023
- var require_cjs = __commonJS({
42024
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
42025
- "use strict";
42026
- var isMergeableObject = function isMergeableObject2(value) {
42027
- return isNonNullObject(value) && !isSpecial(value);
42028
- };
42029
- function isNonNullObject(value) {
42030
- return !!value && typeof value === "object";
42031
- }
42032
- function isSpecial(value) {
42033
- var stringValue = Object.prototype.toString.call(value);
42034
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
42035
- }
42036
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
42037
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
42038
- function isReactElement(value) {
42039
- return value.$$typeof === REACT_ELEMENT_TYPE;
42040
- }
42041
- function emptyTarget(val) {
42042
- return Array.isArray(val) ? [] : {};
42043
- }
42044
- function cloneUnlessOtherwiseSpecified(value, options) {
42045
- return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
42046
- }
42047
- function defaultArrayMerge(target, source, options) {
42048
- return target.concat(source).map(function(element) {
42049
- return cloneUnlessOtherwiseSpecified(element, options);
42050
- });
42051
- }
42052
- function getMergeFunction(key, options) {
42053
- if (!options.customMerge) {
42054
- return deepmerge;
42055
- }
42056
- var customMerge = options.customMerge(key);
42057
- return typeof customMerge === "function" ? customMerge : deepmerge;
42058
- }
42059
- function getEnumerableOwnPropertySymbols(target) {
42060
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
42061
- return target.propertyIsEnumerable(symbol);
42062
- }) : [];
42063
- }
42064
- function getKeys(target) {
42065
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
42066
- }
42067
- function propertyIsOnObject(object, property) {
42068
- try {
42069
- return property in object;
42070
- } catch (_) {
42071
- return false;
42072
- }
42073
- }
42074
- function propertyIsUnsafe(target, key) {
42075
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
42076
- }
42077
- function mergeObject(target, source, options) {
42078
- var destination = {};
42079
- if (options.isMergeableObject(target)) {
42080
- getKeys(target).forEach(function(key) {
42081
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
42082
- });
42083
- }
42084
- getKeys(source).forEach(function(key) {
42085
- if (propertyIsUnsafe(target, key)) {
42086
- return;
42087
- }
42088
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
42089
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
42090
- } else {
42091
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
42092
- }
42093
- });
42094
- return destination;
42095
- }
42096
- function deepmerge(target, source, options) {
42097
- options = options || {};
42098
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
42099
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
42100
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
42101
- var sourceIsArray = Array.isArray(source);
42102
- var targetIsArray = Array.isArray(target);
42103
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
42104
- if (!sourceAndTargetTypesMatch) {
42105
- return cloneUnlessOtherwiseSpecified(source, options);
42106
- } else if (sourceIsArray) {
42107
- return options.arrayMerge(target, source, options);
42108
- } else {
42109
- return mergeObject(target, source, options);
42110
- }
42111
- }
42112
- deepmerge.all = function deepmergeAll(array, options) {
42113
- if (!Array.isArray(array)) {
42114
- throw new Error("first argument should be an array");
42115
- }
42116
- return array.reduce(function(prev, next) {
42117
- return deepmerge(prev, next, options);
42118
- }, {});
42119
- };
42120
- var deepmerge_1 = deepmerge;
42121
- module2.exports = deepmerge_1;
42122
- }
42123
- });
42124
-
42125
42022
  // ../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js
42126
42023
  var require_tslib = __commonJS({
42127
42024
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module2) {
@@ -44391,7 +44288,7 @@ var require_path_visitor = __commonJS({
44391
44288
  }
44392
44289
  return target;
44393
44290
  }
44394
- PathVisitor.visit = function visit3(node, methods) {
44291
+ PathVisitor.visit = function visit2(node, methods) {
44395
44292
  return PathVisitor.fromMethodsObject(methods).visit(node);
44396
44293
  };
44397
44294
  var PVp = PathVisitor.prototype;
@@ -44582,7 +44479,7 @@ var require_path_visitor = __commonJS({
44582
44479
  this.needToCallTraverse = false;
44583
44480
  return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
44584
44481
  };
44585
- sharedContextProtoMethods.visit = function visit3(path2, newVisitor) {
44482
+ sharedContextProtoMethods.visit = function visit2(path2, newVisitor) {
44586
44483
  if (!(this instanceof this.Context)) {
44587
44484
  throw new Error("");
44588
44485
  }
@@ -45975,7 +45872,7 @@ var require_main = __commonJS({
45975
45872
  var someField = _a.someField;
45976
45873
  var Type = _a.Type;
45977
45874
  var use = _a.use;
45978
- var visit3 = _a.visit;
45875
+ var visit2 = _a.visit;
45979
45876
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
45980
45877
  exports.builders = builders;
45981
45878
  exports.builtInTypes = builtInTypes;
@@ -45992,7 +45889,7 @@ var require_main = __commonJS({
45992
45889
  exports.someField = someField;
45993
45890
  exports.Type = Type;
45994
45891
  exports.use = use;
45995
- exports.visit = visit3;
45892
+ exports.visit = visit2;
45996
45893
  Object.assign(namedTypes_1.namedTypes, n);
45997
45894
  }
45998
45895
  });
@@ -58454,6 +58351,109 @@ var require_main2 = __commonJS({
58454
58351
  }
58455
58352
  });
58456
58353
 
58354
+ // ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
58355
+ var require_cjs = __commonJS({
58356
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
58357
+ "use strict";
58358
+ var isMergeableObject = function isMergeableObject2(value) {
58359
+ return isNonNullObject(value) && !isSpecial(value);
58360
+ };
58361
+ function isNonNullObject(value) {
58362
+ return !!value && typeof value === "object";
58363
+ }
58364
+ function isSpecial(value) {
58365
+ var stringValue = Object.prototype.toString.call(value);
58366
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
58367
+ }
58368
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
58369
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
58370
+ function isReactElement(value) {
58371
+ return value.$$typeof === REACT_ELEMENT_TYPE;
58372
+ }
58373
+ function emptyTarget(val) {
58374
+ return Array.isArray(val) ? [] : {};
58375
+ }
58376
+ function cloneUnlessOtherwiseSpecified(value, options) {
58377
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
58378
+ }
58379
+ function defaultArrayMerge(target, source, options) {
58380
+ return target.concat(source).map(function(element) {
58381
+ return cloneUnlessOtherwiseSpecified(element, options);
58382
+ });
58383
+ }
58384
+ function getMergeFunction(key, options) {
58385
+ if (!options.customMerge) {
58386
+ return deepmerge;
58387
+ }
58388
+ var customMerge = options.customMerge(key);
58389
+ return typeof customMerge === "function" ? customMerge : deepmerge;
58390
+ }
58391
+ function getEnumerableOwnPropertySymbols(target) {
58392
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
58393
+ return target.propertyIsEnumerable(symbol);
58394
+ }) : [];
58395
+ }
58396
+ function getKeys(target) {
58397
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
58398
+ }
58399
+ function propertyIsOnObject(object, property) {
58400
+ try {
58401
+ return property in object;
58402
+ } catch (_) {
58403
+ return false;
58404
+ }
58405
+ }
58406
+ function propertyIsUnsafe(target, key) {
58407
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
58408
+ }
58409
+ function mergeObject(target, source, options) {
58410
+ var destination = {};
58411
+ if (options.isMergeableObject(target)) {
58412
+ getKeys(target).forEach(function(key) {
58413
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
58414
+ });
58415
+ }
58416
+ getKeys(source).forEach(function(key) {
58417
+ if (propertyIsUnsafe(target, key)) {
58418
+ return;
58419
+ }
58420
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
58421
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
58422
+ } else {
58423
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
58424
+ }
58425
+ });
58426
+ return destination;
58427
+ }
58428
+ function deepmerge(target, source, options) {
58429
+ options = options || {};
58430
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
58431
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
58432
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
58433
+ var sourceIsArray = Array.isArray(source);
58434
+ var targetIsArray = Array.isArray(target);
58435
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
58436
+ if (!sourceAndTargetTypesMatch) {
58437
+ return cloneUnlessOtherwiseSpecified(source, options);
58438
+ } else if (sourceIsArray) {
58439
+ return options.arrayMerge(target, source, options);
58440
+ } else {
58441
+ return mergeObject(target, source, options);
58442
+ }
58443
+ }
58444
+ deepmerge.all = function deepmergeAll(array, options) {
58445
+ if (!Array.isArray(array)) {
58446
+ throw new Error("first argument should be an array");
58447
+ }
58448
+ return array.reduce(function(prev, next) {
58449
+ return deepmerge(prev, next, options);
58450
+ }, {});
58451
+ };
58452
+ var deepmerge_1 = deepmerge;
58453
+ module2.exports = deepmerge_1;
58454
+ }
58455
+ });
58456
+
58457
58457
  // src/lib/index.ts
58458
58458
  var lib_exports = {};
58459
58459
  __export(lib_exports, {
@@ -65276,7 +65276,8 @@ var CacheInternal = class {
65276
65276
  parent = rootID,
65277
65277
  variables,
65278
65278
  stepsFromConnection = null,
65279
- ignoreMasking
65279
+ ignoreMasking,
65280
+ fullCheck = false
65280
65281
  }) {
65281
65282
  if (parent === null) {
65282
65283
  return { data: null, partial: false, stale: false, hasData: true };
@@ -65301,11 +65302,28 @@ var CacheInternal = class {
65301
65302
  let targetSelection = getFieldsForType(selection, typename);
65302
65303
  for (const [
65303
65304
  attributeName,
65304
- { type, keyRaw, selection: fieldSelection, nullable, list, visible }
65305
+ { type, keyRaw, selection: fieldSelection, nullable, list, visible, directives }
65305
65306
  ] of Object.entries(targetSelection)) {
65306
- if (!visible && !ignoreMasking) {
65307
+ if (!visible && !ignoreMasking && !fullCheck) {
65307
65308
  continue;
65308
65309
  }
65310
+ const includeDirective = directives?.find((d) => {
65311
+ return d.name === "include";
65312
+ });
65313
+ if (includeDirective) {
65314
+ if (!evaluateFragmentVariables(includeDirective.arguments, variables ?? {})["if"]) {
65315
+ continue;
65316
+ }
65317
+ }
65318
+ const skipDirective = directives?.find((d) => {
65319
+ return d.name === "skip";
65320
+ });
65321
+ if (skipDirective) {
65322
+ if (evaluateFragmentVariables(skipDirective.arguments, variables ?? {})["if"]) {
65323
+ continue;
65324
+ }
65325
+ }
65326
+ const fieldTarget = visible || ignoreMasking ? target : {};
65309
65327
  const key = evaluateKey(keyRaw, variables);
65310
65328
  const { value } = this.storage.get(parent, key);
65311
65329
  const dt_field = this.staleManager.getFieldTime(parent, key);
@@ -65328,16 +65346,16 @@ var CacheInternal = class {
65328
65346
  partial = true;
65329
65347
  }
65330
65348
  if (typeof value === "undefined" || value === null) {
65331
- target[attributeName] = null;
65349
+ fieldTarget[attributeName] = null;
65332
65350
  if (typeof value !== "undefined") {
65333
65351
  hasData = true;
65334
65352
  }
65335
65353
  } else if (!fieldSelection) {
65336
65354
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
65337
65355
  if (fnUnmarshal) {
65338
- target[attributeName] = fnUnmarshal(value);
65356
+ fieldTarget[attributeName] = fnUnmarshal(value);
65339
65357
  } else {
65340
- target[attributeName] = value;
65358
+ fieldTarget[attributeName] = value;
65341
65359
  }
65342
65360
  hasData = true;
65343
65361
  } else if (Array.isArray(value)) {
@@ -65346,9 +65364,10 @@ var CacheInternal = class {
65346
65364
  variables,
65347
65365
  linkedList: value,
65348
65366
  stepsFromConnection: nextStep,
65349
- ignoreMasking: !!ignoreMasking
65367
+ ignoreMasking: !!ignoreMasking,
65368
+ fullCheck
65350
65369
  });
65351
- target[attributeName] = listValue.data;
65370
+ fieldTarget[attributeName] = listValue.data;
65352
65371
  if (listValue.partial) {
65353
65372
  partial = true;
65354
65373
  }
@@ -65364,9 +65383,10 @@ var CacheInternal = class {
65364
65383
  selection: fieldSelection,
65365
65384
  variables,
65366
65385
  stepsFromConnection: nextStep,
65367
- ignoreMasking
65386
+ ignoreMasking,
65387
+ fullCheck
65368
65388
  });
65369
- target[attributeName] = objectFields.data;
65389
+ fieldTarget[attributeName] = objectFields.data;
65370
65390
  if (objectFields.partial) {
65371
65391
  partial = true;
65372
65392
  }
@@ -65377,7 +65397,7 @@ var CacheInternal = class {
65377
65397
  hasData = true;
65378
65398
  }
65379
65399
  }
65380
- if (target[attributeName] === null && !nullable && !embeddedCursor) {
65400
+ if (fieldTarget[attributeName] === null && !nullable && !embeddedCursor) {
65381
65401
  cascadeNull = true;
65382
65402
  }
65383
65403
  }
@@ -65409,7 +65429,8 @@ var CacheInternal = class {
65409
65429
  variables,
65410
65430
  linkedList,
65411
65431
  stepsFromConnection,
65412
- ignoreMasking
65432
+ ignoreMasking,
65433
+ fullCheck
65413
65434
  }) {
65414
65435
  const result = [];
65415
65436
  let partialData = false;
@@ -65422,7 +65443,8 @@ var CacheInternal = class {
65422
65443
  variables,
65423
65444
  linkedList: entry,
65424
65445
  stepsFromConnection,
65425
- ignoreMasking
65446
+ ignoreMasking,
65447
+ fullCheck
65426
65448
  });
65427
65449
  result.push(nestedValue.data);
65428
65450
  if (nestedValue.partial) {
@@ -65444,7 +65466,8 @@ var CacheInternal = class {
65444
65466
  selection: fields,
65445
65467
  variables,
65446
65468
  stepsFromConnection,
65447
- ignoreMasking
65469
+ ignoreMasking,
65470
+ fullCheck
65448
65471
  });
65449
65472
  result.push(data);
65450
65473
  if (partial) {
@@ -65603,12 +65626,12 @@ var cachePolicy = ({
65603
65626
  network(ctx, { initialValue, next, resolve: resolve2, marshalVariables: marshalVariables2 }) {
65604
65627
  const { policy, artifact } = ctx;
65605
65628
  let useCache = false;
65606
- if (enabled && (artifact.kind === ArtifactKind.Query || artifact.kind === ArtifactKind.Fragment) && !ctx.cacheParams?.disableRead) {
65629
+ if (enabled && artifact.kind === ArtifactKind.Query && !ctx.cacheParams?.disableRead) {
65607
65630
  if (policy !== CachePolicy.NetworkOnly) {
65608
65631
  const value = localCache.read({
65609
65632
  selection: artifact.selection,
65610
65633
  variables: marshalVariables2(ctx),
65611
- parent: ctx.stuff?.parentID
65634
+ fullCheck: true
65612
65635
  });
65613
65636
  const allowed = !value.partial || artifact.kind === ArtifactKind.Query && artifact.partial;
65614
65637
  if (policy === CachePolicy.CacheOnly) {
@@ -65644,9 +65667,7 @@ var cachePolicy = ({
65644
65667
  localCache._internal_unstable.collectGarbage();
65645
65668
  }, 0);
65646
65669
  }
65647
- if (!ctx.stuff?.silenceLoading) {
65648
- setFetching(!useCache);
65649
- }
65670
+ setFetching(!useCache);
65650
65671
  return next(ctx);
65651
65672
  },
65652
65673
  afterNetwork(ctx, { resolve: resolve2, value, marshalVariables: marshalVariables2 }) {
@@ -65726,11 +65747,10 @@ var query = documentPlugin(ArtifactKind.Query, function() {
65726
65747
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
65727
65748
  }
65728
65749
  lastVariables = { ...marshalVariables2(ctx) };
65729
- const variables = lastVariables;
65730
65750
  subscriptionSpec = {
65731
65751
  rootType: ctx.artifact.rootType,
65732
65752
  selection: ctx.artifact.selection,
65733
- variables: () => variables,
65753
+ variables: () => lastVariables,
65734
65754
  set: (newValue) => {
65735
65755
  resolve2(ctx, {
65736
65756
  data: newValue,
@@ -65759,17 +65779,12 @@ var query = documentPlugin(ArtifactKind.Query, function() {
65759
65779
  // src/runtime/client/plugins/fragment.ts
65760
65780
  var fragment = documentPlugin(ArtifactKind.Fragment, function() {
65761
65781
  let subscriptionSpec = null;
65762
- let lastReference = null;
65763
65782
  return {
65764
65783
  start(ctx, { next, resolve: resolve2, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
65765
65784
  if (!ctx.stuff.parentID) {
65766
65785
  return next(ctx);
65767
65786
  }
65768
- const currentReference = {
65769
- parent: ctx.stuff.parentID,
65770
- variables: marshalVariables2(ctx)
65771
- };
65772
- if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
65787
+ if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
65773
65788
  if (subscriptionSpec) {
65774
65789
  cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
65775
65790
  }
@@ -65792,7 +65807,6 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
65792
65807
  }
65793
65808
  };
65794
65809
  cache_default.subscribe(subscriptionSpec, variables);
65795
- lastReference = currentReference;
65796
65810
  }
65797
65811
  next(ctx);
65798
65812
  },
@@ -65993,7 +66007,6 @@ var DocumentStore = class extends Writable {
65993
66007
  #plugins;
65994
66008
  #lastVariables;
65995
66009
  #lastContext = null;
65996
- pendingPromise = null;
65997
66010
  constructor({
65998
66011
  artifact,
65999
66012
  plugins: plugins2,
@@ -66066,7 +66079,7 @@ var DocumentStore = class extends Writable {
66066
66079
  const draft = context.draft();
66067
66080
  draft.variables = variables ?? null;
66068
66081
  context = context.apply(draft, false);
66069
- const promise = new Promise((resolve2, reject) => {
66082
+ return await new Promise((resolve2, reject) => {
66070
66083
  const state = {
66071
66084
  setup,
66072
66085
  currentStep: 0,
@@ -66075,17 +66088,12 @@ var DocumentStore = class extends Writable {
66075
66088
  promise: {
66076
66089
  resolved: false,
66077
66090
  resolve: resolve2,
66078
- reject,
66079
- then: (...args) => promise.then(...args)
66091
+ reject
66080
66092
  },
66081
66093
  context
66082
66094
  };
66083
- if (this.pendingPromise === null) {
66084
- this.pendingPromise = state.promise;
66085
- }
66086
66095
  this.#step("forward", state);
66087
66096
  });
66088
- return await promise;
66089
66097
  }
66090
66098
  async cleanup() {
66091
66099
  for (const plugin2 of this.#plugins) {
@@ -66204,15 +66212,16 @@ var DocumentStore = class extends Writable {
66204
66212
  value
66205
66213
  );
66206
66214
  }
66207
- if (!ctx.silenceEcho || value.data !== this.state.data) {
66208
- this.set(value);
66209
- }
66210
66215
  if (!ctx.promise.resolved) {
66211
66216
  ctx.promise.resolve(value);
66212
66217
  ctx.promise.resolved = true;
66213
66218
  }
66214
66219
  this.#lastContext = ctx.context.draft();
66215
66220
  this.#lastVariables = this.#lastContext.stuff.inputs.marshaled;
66221
+ if (ctx.silenceEcho && value.data === this.state.data) {
66222
+ return;
66223
+ }
66224
+ this.set(value);
66216
66225
  }
66217
66226
  };
66218
66227
  var ClientPluginContextWrapper = class {
@@ -66831,17 +66840,6 @@ var Config = class {
66831
66840
  }, []) ?? [];
66832
66841
  return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
66833
66842
  }
66834
- needsRefetchArtifact(document) {
66835
- let needsArtifact = false;
66836
- graphql2.visit(document, {
66837
- Directive: (node) => {
66838
- if ([this.paginateDirective].includes(node.name.value)) {
66839
- needsArtifact = true;
66840
- }
66841
- }
66842
- });
66843
- return needsArtifact;
66844
- }
66845
66843
  #fragmentVariableMaps;
66846
66844
  registerFragmentVariablesHash({
66847
66845
  hash,
@@ -66849,7 +66847,7 @@ var Config = class {
66849
66847
  fragment: fragment2
66850
66848
  }) {
66851
66849
  this.#fragmentVariableMaps[hash] = {
66852
- args: this.#serializeValueMap(args),
66850
+ args: this.serializeValueMap(args),
66853
66851
  fragment: fragment2
66854
66852
  };
66855
66853
  }
@@ -66860,7 +66858,7 @@ var Config = class {
66860
66858
  hash
66861
66859
  };
66862
66860
  }
66863
- #serializeValueMap(map) {
66861
+ serializeValueMap(map) {
66864
66862
  if (!map) {
66865
66863
  return null;
66866
66864
  }
@@ -66875,7 +66873,7 @@ var Config = class {
66875
66873
  }
66876
66874
  if ("values" in input) {
66877
66875
  result.values = input.values.map(
66878
- (value) => this.#serializeValueMap({ foo: value }).foo
66876
+ (value) => this.serializeValueMap({ foo: value }).foo
66879
66877
  );
66880
66878
  }
66881
66879
  if ("name" in input) {
@@ -66884,7 +66882,7 @@ var Config = class {
66884
66882
  if ("fields" in input) {
66885
66883
  result.fields = input.fields.map((field) => ({
66886
66884
  name: field.name,
66887
- value: this.#serializeValueMap({ foo: field.value }).foo
66885
+ value: this.serializeValueMap({ foo: field.value }).foo
66888
66886
  }));
66889
66887
  }
66890
66888
  }
@@ -67337,40 +67335,13 @@ var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
67337
67335
 
67338
67336
  // src/lib/parse.ts
67339
67337
  var import_parser = __toESM(require_lib3(), 1);
67340
-
67341
- // src/lib/deepMerge.ts
67342
- var import_deepmerge = __toESM(require_cjs(), 1);
67343
- function deepMerge(filepath, ...targets) {
67344
- try {
67345
- if (targets.length === 1) {
67346
- return targets[0];
67347
- } else if (targets.length === 2) {
67348
- return (0, import_deepmerge.default)(targets[0], targets[1], {
67349
- arrayMerge: (source, update) => [...new Set(source.concat(update))]
67350
- });
67351
- }
67352
- return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
67353
- } catch (e2) {
67354
- throw new HoudiniError({
67355
- filepath,
67356
- message: "could not merge: " + JSON.stringify(targets, null, 4),
67357
- description: e2.message
67358
- });
67359
- }
67360
- }
67361
-
67362
- // src/lib/parse.ts
67363
- async function parseJS(str, config) {
67364
- const defaultConfig = {
67365
- plugins: ["typescript"],
67366
- sourceType: "module"
67367
- };
67338
+ async function parseJS(str) {
67368
67339
  return {
67369
67340
  start: 0,
67370
- script: (0, import_parser.parse)(
67371
- str || "",
67372
- config ? deepMerge("", defaultConfig, config) : defaultConfig
67373
- ).program,
67341
+ script: (0, import_parser.parse)(str || "", {
67342
+ plugins: ["typescript"],
67343
+ sourceType: "module"
67344
+ }).program,
67374
67345
  end: str.length
67375
67346
  };
67376
67347
  }
@@ -67438,6 +67409,27 @@ async function cleanupFiles(pathFolder, listOfObj) {
67438
67409
  return allFilesNotInList;
67439
67410
  }
67440
67411
 
67412
+ // src/lib/deepMerge.ts
67413
+ var import_deepmerge = __toESM(require_cjs(), 1);
67414
+ function deepMerge(filepath, ...targets) {
67415
+ try {
67416
+ if (targets.length === 1) {
67417
+ return targets[0];
67418
+ } else if (targets.length === 2) {
67419
+ return (0, import_deepmerge.default)(targets[0], targets[1], {
67420
+ arrayMerge: (source, update) => [...new Set(source.concat(update))]
67421
+ });
67422
+ }
67423
+ return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
67424
+ } catch (e2) {
67425
+ throw new HoudiniError({
67426
+ filepath,
67427
+ message: "could not merge: " + targets,
67428
+ description: e2.message
67429
+ });
67430
+ }
67431
+ }
67432
+
67441
67433
  // src/lib/detectTools.ts
67442
67434
  async function detectFromPackageJSON(cwd) {
67443
67435
  try {