houdini 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/build/cmd-cjs/index.js +149 -104
  2. package/build/cmd-esm/index.js +149 -104
  3. package/build/codegen/generators/artifacts/selection.d.ts +2 -1
  4. package/build/codegen/utils/flattenSelections.d.ts +2 -4
  5. package/build/codegen-cjs/index.js +147 -102
  6. package/build/codegen-esm/index.js +147 -102
  7. package/build/lib-cjs/index.js +103 -45
  8. package/build/lib-esm/index.js +103 -45
  9. package/build/runtime/cache/cache.d.ts +3 -1
  10. package/build/runtime/cache/lists.d.ts +3 -3
  11. package/build/runtime/cache/storage.d.ts +2 -2
  12. package/build/runtime/cache/subscription.d.ts +1 -0
  13. package/build/runtime-cjs/cache/cache.d.ts +3 -1
  14. package/build/runtime-cjs/cache/cache.js +78 -27
  15. package/build/runtime-cjs/cache/lists.d.ts +3 -3
  16. package/build/runtime-cjs/cache/lists.js +7 -7
  17. package/build/runtime-cjs/cache/storage.d.ts +2 -2
  18. package/build/runtime-cjs/cache/storage.js +5 -5
  19. package/build/runtime-cjs/cache/subscription.d.ts +1 -0
  20. package/build/runtime-cjs/cache/subscription.js +3 -0
  21. package/build/runtime-cjs/client/plugins/mutation.js +10 -6
  22. package/build/runtime-esm/cache/cache.d.ts +3 -1
  23. package/build/runtime-esm/cache/cache.js +78 -27
  24. package/build/runtime-esm/cache/lists.d.ts +3 -3
  25. package/build/runtime-esm/cache/lists.js +7 -7
  26. package/build/runtime-esm/cache/storage.d.ts +2 -2
  27. package/build/runtime-esm/cache/storage.js +5 -5
  28. package/build/runtime-esm/cache/subscription.d.ts +1 -0
  29. package/build/runtime-esm/cache/subscription.js +3 -0
  30. package/build/runtime-esm/client/plugins/mutation.js +10 -6
  31. package/build/test-cjs/index.js +147 -102
  32. package/build/test-esm/index.js +147 -102
  33. package/build/vite-cjs/index.js +147 -102
  34. package/build/vite-esm/index.js +147 -102
  35. package/package.json +1 -1
@@ -54770,10 +54770,10 @@ var ListManager = class {
54770
54770
  this.lists.get(list.name).get(parentID).lists.push(handler);
54771
54771
  this.listsByField.get(parentID).get(list.key).push(handler);
54772
54772
  }
54773
- removeIDFromAllLists(id) {
54773
+ removeIDFromAllLists(id, layer) {
54774
54774
  for (const fieldMap of this.lists.values()) {
54775
54775
  for (const list of fieldMap.values()) {
54776
- list.removeID(id);
54776
+ list.removeID(id, void 0, layer);
54777
54777
  }
54778
54778
  }
54779
54779
  }
@@ -54930,7 +54930,7 @@ var List = class {
54930
54930
  layer: layer?.id
54931
54931
  });
54932
54932
  }
54933
- removeID(id, variables = {}) {
54933
+ removeID(id, variables = {}, layer) {
54934
54934
  if (!this.validateWhen()) {
54935
54935
  return;
54936
54936
  }
@@ -54977,7 +54977,7 @@ var List = class {
54977
54977
  subscribers.map((sub) => sub[0]),
54978
54978
  variables
54979
54979
  );
54980
- this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
54980
+ this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID, layer);
54981
54981
  for (const [spec] of subscribers) {
54982
54982
  spec.set(
54983
54983
  this.cache._internal_unstable.getSelection({
@@ -54990,12 +54990,12 @@ var List = class {
54990
54990
  }
54991
54991
  return true;
54992
54992
  }
54993
- remove(data, variables = {}) {
54993
+ remove(data, variables = {}, layer) {
54994
54994
  const targetID = this.cache._internal_unstable.id(this.listType(data), data);
54995
54995
  if (!targetID) {
54996
54996
  return;
54997
54997
  }
54998
- return this.removeID(targetID, variables);
54998
+ return this.removeID(targetID, variables, layer);
54999
54999
  }
55000
55000
  listType(data) {
55001
55001
  return data.__typename || this.type;
@@ -55027,7 +55027,7 @@ var List = class {
55027
55027
  layer,
55028
55028
  where
55029
55029
  }) {
55030
- if (!this.remove(data, variables)) {
55030
+ if (!this.remove(data, variables, layer)) {
55031
55031
  this.addToList(selection, data, variables, where, layer);
55032
55032
  }
55033
55033
  }
@@ -55164,7 +55164,7 @@ var StaleManager = class {
55164
55164
  // src/runtime/cache/storage.ts
55165
55165
  var InMemoryStorage = class {
55166
55166
  data;
55167
- idCount = 0;
55167
+ idCount = 1;
55168
55168
  rank = 0;
55169
55169
  constructor() {
55170
55170
  this.data = [];
@@ -55184,11 +55184,11 @@ var InMemoryStorage = class {
55184
55184
  insert(id, field, location, target) {
55185
55185
  return this.topLayer.insert(id, field, location, target);
55186
55186
  }
55187
- remove(id, field, target) {
55188
- return this.topLayer.remove(id, field, target);
55187
+ remove(id, field, target, layerToUser = this.topLayer) {
55188
+ return layerToUser.remove(id, field, target);
55189
55189
  }
55190
- delete(id) {
55191
- return this.topLayer.delete(id);
55190
+ delete(id, layerToUser = this.topLayer) {
55191
+ return layerToUser.delete(id);
55192
55192
  }
55193
55193
  deleteField(id, field) {
55194
55194
  return this.topLayer.deleteField(id, field);
@@ -55560,6 +55560,9 @@ var InMemorySubscriptions = class {
55560
55560
  subscribers = {};
55561
55561
  referenceCounts = {};
55562
55562
  keyVersions = {};
55563
+ activeFields(parent2) {
55564
+ return Object.keys(this.subscribers[parent2] || {});
55565
+ }
55563
55566
  add({
55564
55567
  parent: parent2,
55565
55568
  spec,
@@ -55828,20 +55831,7 @@ var Cache = class {
55828
55831
  }) {
55829
55832
  const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
55830
55833
  const subscribers = this._internal_unstable.writeSelection({ ...args, layer }).map((sub) => sub[0]);
55831
- const notified = [];
55832
- for (const spec of subscribers.concat(notifySubscribers)) {
55833
- if (!notified.includes(spec.set)) {
55834
- notified.push(spec.set);
55835
- spec.set(
55836
- this._internal_unstable.getSelection({
55837
- parent: spec.parentID || rootID,
55838
- selection: spec.selection,
55839
- variables: spec.variables?.() || {},
55840
- ignoreMasking: false
55841
- }).data
55842
- );
55843
- }
55844
- }
55834
+ this.#notifySubscribers(subscribers.concat(notifySubscribers));
55845
55835
  return subscribers;
55846
55836
  }
55847
55837
  read(...args) {
@@ -55880,10 +55870,10 @@ var Cache = class {
55880
55870
  }
55881
55871
  return handler;
55882
55872
  }
55883
- delete(id) {
55873
+ delete(id, layer) {
55884
55874
  this._internal_unstable.subscriptions.removeAllSubscribers(id);
55885
- this._internal_unstable.lists.removeIDFromAllLists(id);
55886
- this._internal_unstable.storage.delete(id);
55875
+ this._internal_unstable.lists.removeIDFromAllLists(id, layer);
55876
+ this._internal_unstable.storage.delete(id, layer);
55887
55877
  }
55888
55878
  setConfig(config2) {
55889
55879
  this._internal_unstable.setConfig(config2);
@@ -55915,6 +55905,70 @@ var Cache = class {
55915
55905
  config() {
55916
55906
  return this._internal_unstable.config;
55917
55907
  }
55908
+ clearLayer(layerID) {
55909
+ const layer = this._internal_unstable.storage.getLayer(layerID);
55910
+ if (!layer) {
55911
+ throw new Error("Cannot find layer with id: " + layerID);
55912
+ }
55913
+ const toNotify = [];
55914
+ const allFields = [];
55915
+ for (const target of [layer.fields, layer.links]) {
55916
+ for (const [id, fields] of Object.entries(target)) {
55917
+ allFields.push(
55918
+ ...Object.entries(fields).map(([field, value]) => ({ id, field, value }))
55919
+ );
55920
+ }
55921
+ }
55922
+ const displayFields = [];
55923
+ for (const pair of allFields) {
55924
+ const { displayLayers } = this._internal_unstable.storage.get(pair.id, pair.field);
55925
+ if (!displayLayers.includes(layerID)) {
55926
+ continue;
55927
+ }
55928
+ displayFields.push(pair);
55929
+ }
55930
+ for (const [id, operation] of Object.entries(layer.operations)) {
55931
+ if (operation.deleted) {
55932
+ displayFields.push(
55933
+ ...this._internal_unstable.subscriptions.activeFields(id).map((field) => ({ id, field }))
55934
+ );
55935
+ }
55936
+ const fields = Object.keys(operation.fields ?? {});
55937
+ if (fields.length > 0) {
55938
+ displayFields.push(...fields.map((field) => ({ id, field })));
55939
+ }
55940
+ }
55941
+ layer.clear();
55942
+ for (const display of displayFields) {
55943
+ const { field, id } = display;
55944
+ const notify = !("value" in display) || this._internal_unstable.storage.get(id, field).value !== display.value;
55945
+ if (notify) {
55946
+ toNotify.push(
55947
+ ...this._internal_unstable.subscriptions.get(id, field).map((sub) => sub[0])
55948
+ );
55949
+ }
55950
+ }
55951
+ this.#notifySubscribers(toNotify);
55952
+ }
55953
+ #notifySubscribers(subs) {
55954
+ if (subs.length === 0) {
55955
+ return;
55956
+ }
55957
+ const notified = [];
55958
+ for (const spec of subs) {
55959
+ if (!notified.includes(spec.set)) {
55960
+ notified.push(spec.set);
55961
+ spec.set(
55962
+ this._internal_unstable.getSelection({
55963
+ parent: spec.parentID || rootID,
55964
+ selection: spec.selection,
55965
+ variables: spec.variables?.() || {},
55966
+ ignoreMasking: false
55967
+ }).data
55968
+ );
55969
+ }
55970
+ }
55971
+ }
55918
55972
  };
55919
55973
  var CacheInternal = class {
55920
55974
  _disabled = false;
@@ -56202,8 +56256,16 @@ var CacheInternal = class {
56202
56256
  operation.position || "last",
56203
56257
  layer
56204
56258
  );
56259
+ } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
56260
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
56261
+ selection: fieldSelection,
56262
+ data: target,
56263
+ variables,
56264
+ where: operation.position || "last",
56265
+ layer
56266
+ });
56205
56267
  } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
56206
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
56268
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables, layer);
56207
56269
  } else if (operation.action === "delete" && operation.type) {
56208
56270
  if (typeof target !== "string") {
56209
56271
  throw new Error("Cannot delete a record with a non-string ID");
@@ -56212,15 +56274,7 @@ var CacheInternal = class {
56212
56274
  if (!targetID) {
56213
56275
  continue;
56214
56276
  }
56215
- this.cache.delete(targetID);
56216
- } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
56217
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
56218
- selection: fieldSelection,
56219
- data: target,
56220
- variables,
56221
- where: operation.position || "last",
56222
- layer
56223
- });
56277
+ this.cache.delete(targetID, layer);
56224
56278
  }
56225
56279
  }
56226
56280
  }
@@ -56755,7 +56809,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
56755
56809
  var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56756
56810
  return {
56757
56811
  async start(ctx, { next, marshalVariables }) {
56758
- const layer = cache_default._internal_unstable.storage.createLayer(true);
56812
+ const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
56759
56813
  const optimisticResponse = ctx.stuff.optimisticResponse;
56760
56814
  let toNotify = [];
56761
56815
  if (optimisticResponse) {
@@ -56766,25 +56820,29 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56766
56820
  data: optimisticResponse
56767
56821
  }),
56768
56822
  variables: marshalVariables(ctx),
56769
- layer: layer.id
56823
+ layer: layerOptimistic.id
56770
56824
  });
56771
56825
  }
56772
56826
  ctx.cacheParams = {
56773
56827
  ...ctx.cacheParams,
56774
- layer,
56828
+ layer: layerOptimistic,
56775
56829
  notifySubscribers: toNotify,
56776
56830
  forceNotify: true
56777
56831
  };
56778
56832
  next(ctx);
56779
56833
  },
56780
56834
  afterNetwork(ctx, { resolve: resolve2 }) {
56781
- ctx.cacheParams?.layer?.clear();
56835
+ if (ctx.cacheParams?.layer) {
56836
+ cache_default.clearLayer(ctx.cacheParams.layer.id);
56837
+ }
56782
56838
  resolve2(ctx);
56783
56839
  },
56784
56840
  end(ctx, { resolve: resolve2, value }) {
56785
56841
  const hasErrors = value.errors && value.errors.length > 0;
56786
56842
  if (hasErrors) {
56787
- ctx.cacheParams?.layer?.clear();
56843
+ if (ctx.cacheParams?.layer) {
56844
+ cache_default.clearLayer(ctx.cacheParams.layer.id);
56845
+ }
56788
56846
  }
56789
56847
  if (ctx.cacheParams?.layer) {
56790
56848
  cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
@@ -56794,7 +56852,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56794
56852
  catch(ctx, { error }) {
56795
56853
  if (ctx.cacheParams?.layer) {
56796
56854
  const { layer } = ctx.cacheParams;
56797
- layer.clear();
56855
+ cache_default.clearLayer(layer.id);
56798
56856
  cache_default._internal_unstable.storage.resolveLayer(layer.id);
56799
56857
  }
56800
56858
  throw error;
@@ -57281,18 +57339,14 @@ function flattenSelections({
57281
57339
  filepath,
57282
57340
  selections,
57283
57341
  fragmentDefinitions,
57284
- ignoreMaskDisable,
57285
- keepFragmentSpreadNodes,
57286
- hoistFragments
57342
+ applyFragments
57287
57343
  }) {
57288
57344
  const fields = new FieldCollection({
57289
57345
  config: config2,
57290
57346
  filepath,
57291
57347
  selections,
57292
57348
  fragmentDefinitions,
57293
- ignoreMaskDisable: !!ignoreMaskDisable,
57294
- keepFragmentSpreadNodes: !!keepFragmentSpreadNodes,
57295
- hoistFragments
57349
+ applyFragments: !!applyFragments
57296
57350
  });
57297
57351
  return fields.toSelectionSet();
57298
57352
  }
@@ -57303,18 +57357,14 @@ var FieldCollection = class {
57303
57357
  fields;
57304
57358
  inlineFragments;
57305
57359
  fragmentSpreads;
57306
- ignoreMaskDisable;
57307
- keepFragmentSpreadNodes;
57308
- hoistFragments;
57360
+ applyFragments;
57309
57361
  constructor(args) {
57310
57362
  this.config = args.config;
57311
57363
  this.fragmentDefinitions = args.fragmentDefinitions;
57312
- this.ignoreMaskDisable = args.ignoreMaskDisable;
57313
- this.keepFragmentSpreadNodes = args.keepFragmentSpreadNodes;
57364
+ this.applyFragments = args.applyFragments;
57314
57365
  this.fields = {};
57315
57366
  this.inlineFragments = {};
57316
57367
  this.fragmentSpreads = {};
57317
- this.hoistFragments = !!args.hoistFragments;
57318
57368
  this.filepath = args.filepath;
57319
57369
  for (const selection of args.selections) {
57320
57370
  this.add({ selection });
@@ -57324,21 +57374,18 @@ var FieldCollection = class {
57324
57374
  return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
57325
57375
  }
57326
57376
  add({ selection, external }) {
57327
- let includeFragments = this.config.defaultFragmentMasking === "disable";
57377
+ let include = this.config.defaultFragmentMasking === "disable";
57328
57378
  const maskEnableDirective = selection.directives?.find(
57329
57379
  ({ name }) => name.value === this.config.maskEnableDirective
57330
57380
  );
57331
57381
  if (maskEnableDirective) {
57332
- includeFragments = false;
57382
+ include = false;
57333
57383
  }
57334
57384
  const maskDisableDirective = selection.directives?.find(
57335
57385
  ({ name }) => name.value === this.config.maskDisableDirective
57336
57386
  );
57337
57387
  if (maskDisableDirective) {
57338
- includeFragments = true;
57339
- }
57340
- if (this.ignoreMaskDisable) {
57341
- includeFragments = true;
57388
+ include = true;
57342
57389
  }
57343
57390
  if (selection.kind === "Field") {
57344
57391
  const key = selection.alias?.value || selection.name.value;
@@ -57354,7 +57401,7 @@ var FieldCollection = class {
57354
57401
  external
57355
57402
  });
57356
57403
  }
57357
- if (!external && includeFragments) {
57404
+ if (this.applyFragments && !external) {
57358
57405
  this.fields[key].selection.fragmentSpreads = {
57359
57406
  ...this.collectFragmentSpreads(selection.selectionSet?.selections ?? []),
57360
57407
  ...this.fields[key].selection.fragmentSpreads
@@ -57368,16 +57415,13 @@ var FieldCollection = class {
57368
57415
  }
57369
57416
  }
57370
57417
  if (selection.kind === "InlineFragment" && selection.typeCondition) {
57371
- this.walkInlineFragment({ selection, external, hoistFragments: this.hoistFragments });
57418
+ this.walkInlineFragment({ selection, external });
57372
57419
  return;
57373
57420
  }
57374
57421
  if (selection.kind === "FragmentSpread") {
57375
- if (this.keepFragmentSpreadNodes && !external) {
57422
+ if (!external || include) {
57376
57423
  this.fragmentSpreads[selection.name.value] = selection;
57377
57424
  }
57378
- if (!includeFragments) {
57379
- return;
57380
- }
57381
57425
  const definition = this.fragmentDefinitions[selection.name.value];
57382
57426
  if (!definition) {
57383
57427
  throw new HoudiniError({
@@ -57385,23 +57429,25 @@ var FieldCollection = class {
57385
57429
  message: "Could not find referenced fragment definition: " + selection.name.value + "\n" + JSON.stringify(Object.keys(this.fragmentDefinitions), null, 4)
57386
57430
  });
57387
57431
  }
57388
- this.add({
57389
- selection: {
57390
- kind: "InlineFragment",
57391
- typeCondition: {
57392
- kind: "NamedType",
57393
- name: {
57394
- kind: "Name",
57395
- value: definition.typeCondition.name.value
57432
+ if (this.applyFragments || include) {
57433
+ this.add({
57434
+ selection: {
57435
+ kind: "InlineFragment",
57436
+ typeCondition: {
57437
+ kind: "NamedType",
57438
+ name: {
57439
+ kind: "Name",
57440
+ value: definition.typeCondition.name.value
57441
+ }
57442
+ },
57443
+ selectionSet: {
57444
+ kind: "SelectionSet",
57445
+ selections: [...definition.selectionSet.selections]
57396
57446
  }
57397
57447
  },
57398
- selectionSet: {
57399
- kind: "SelectionSet",
57400
- selections: [...definition.selectionSet.selections]
57401
- }
57402
- },
57403
- external
57404
- });
57448
+ external: !include
57449
+ });
57450
+ }
57405
57451
  }
57406
57452
  }
57407
57453
  collectFragmentSpreads(selections, result = {}) {
@@ -57458,8 +57504,7 @@ var FieldCollection = class {
57458
57504
  }
57459
57505
  walkInlineFragment({
57460
57506
  selection,
57461
- external,
57462
- hoistFragments
57507
+ external
57463
57508
  }) {
57464
57509
  const key = selection.typeCondition.name.value;
57465
57510
  if (!this.inlineFragments[key]) {
@@ -57469,7 +57514,7 @@ var FieldCollection = class {
57469
57514
  };
57470
57515
  }
57471
57516
  for (const subselect of selection.selectionSet.selections || []) {
57472
- if (subselect.kind === "FragmentSpread" && !hoistFragments || subselect.kind === "Field" || subselect.kind === "InlineFragment" && !subselect.typeCondition) {
57517
+ if (subselect.kind === "Field" || subselect.kind === "InlineFragment" && !subselect.typeCondition) {
57473
57518
  this.inlineFragments[key].selection.add({
57474
57519
  selection: subselect,
57475
57520
  external
@@ -57478,11 +57523,11 @@ var FieldCollection = class {
57478
57523
  } else if (subselect.kind === "FragmentSpread") {
57479
57524
  this.add({
57480
57525
  selection: subselect,
57481
- external: true
57526
+ external
57482
57527
  });
57483
57528
  continue;
57484
57529
  } else {
57485
- this.walkInlineFragment({ selection: subselect, external, hoistFragments });
57530
+ this.walkInlineFragment({ selection: subselect, external });
57486
57531
  }
57487
57532
  }
57488
57533
  }
@@ -57492,9 +57537,7 @@ var FieldCollection = class {
57492
57537
  fragmentDefinitions: this.fragmentDefinitions,
57493
57538
  selections: [],
57494
57539
  filepath: this.filepath,
57495
- ignoreMaskDisable: this.ignoreMaskDisable,
57496
- keepFragmentSpreadNodes: this.keepFragmentSpreadNodes,
57497
- hoistFragments: this.hoistFragments
57540
+ applyFragments: this.applyFragments
57498
57541
  });
57499
57542
  }
57500
57543
  };
@@ -58423,7 +58466,7 @@ function operationObject({
58423
58466
  if (operationKind === "insert" || operationKind === "toggle") {
58424
58467
  operation.position = position;
58425
58468
  }
58426
- if (operationKind === "insert" && allLists) {
58469
+ if (allLists && operationKind !== "delete") {
58427
58470
  operation.target = "all";
58428
58471
  }
58429
58472
  if (parentID) {
@@ -59414,7 +59457,8 @@ function prepareSelection({
59414
59457
  inConnection,
59415
59458
  typeMap,
59416
59459
  abstractTypes,
59417
- globalLoading
59460
+ globalLoading,
59461
+ includeFragments
59418
59462
  }) {
59419
59463
  let object = {};
59420
59464
  const loadingTypes = [];
@@ -59434,7 +59478,8 @@ function prepareSelection({
59434
59478
  document,
59435
59479
  typeMap,
59436
59480
  abstractTypes,
59437
- globalLoading
59481
+ globalLoading,
59482
+ includeFragments
59438
59483
  }).fields || {}
59439
59484
  );
59440
59485
  } else {
@@ -59482,7 +59527,8 @@ function prepareSelection({
59482
59527
  document,
59483
59528
  typeMap,
59484
59529
  abstractTypes,
59485
- globalLoading
59530
+ globalLoading,
59531
+ includeFragments
59486
59532
  }).fields
59487
59533
  };
59488
59534
  if (field.directives?.find((d) => d.name.value === config2.loadingDirective)) {
@@ -59600,7 +59646,8 @@ function prepareSelection({
59600
59646
  inConnection: connectionState,
59601
59647
  typeMap,
59602
59648
  abstractTypes,
59603
- globalLoading: forceLoading
59649
+ globalLoading: forceLoading,
59650
+ includeFragments
59604
59651
  });
59605
59652
  if (Object.values(fieldObj.selection.fields ?? {}).some((field2) => field2.required)) {
59606
59653
  fieldObj.nullable = true;
@@ -59933,14 +59980,13 @@ function artifactGenerator(stats) {
59933
59980
  document: doc,
59934
59981
  rootType,
59935
59982
  globalLoading,
59983
+ includeFragments: doc.kind !== ArtifactKind.Fragment,
59936
59984
  selections: flattenSelections({
59937
59985
  config: config2,
59938
59986
  filepath: doc.filename,
59939
59987
  selections: selectionSet.selections,
59940
59988
  fragmentDefinitions,
59941
- ignoreMaskDisable: docKind !== "HoudiniFragment",
59942
- keepFragmentSpreadNodes: true,
59943
- hoistFragments: true
59989
+ applyFragments: doc.kind !== ArtifactKind.Fragment
59944
59990
  }),
59945
59991
  operations: operationsByPath(
59946
59992
  config2,
@@ -60905,8 +60951,7 @@ async function generateDocumentTypes(config2, docs) {
60905
60951
  config: config2,
60906
60952
  filepath: filename,
60907
60953
  selections: definition.selectionSet.selections,
60908
- fragmentDefinitions,
60909
- keepFragmentSpreadNodes: true
60954
+ fragmentDefinitions
60910
60955
  });
60911
60956
  if (definition?.kind === "OperationDefinition") {
60912
60957
  await generateOperationTypeDefs(