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
@@ -54771,10 +54771,10 @@ var ListManager = class {
54771
54771
  this.lists.get(list.name).get(parentID).lists.push(handler);
54772
54772
  this.listsByField.get(parentID).get(list.key).push(handler);
54773
54773
  }
54774
- removeIDFromAllLists(id) {
54774
+ removeIDFromAllLists(id, layer) {
54775
54775
  for (const fieldMap of this.lists.values()) {
54776
54776
  for (const list of fieldMap.values()) {
54777
- list.removeID(id);
54777
+ list.removeID(id, void 0, layer);
54778
54778
  }
54779
54779
  }
54780
54780
  }
@@ -54931,7 +54931,7 @@ var List = class {
54931
54931
  layer: layer?.id
54932
54932
  });
54933
54933
  }
54934
- removeID(id, variables = {}) {
54934
+ removeID(id, variables = {}, layer) {
54935
54935
  if (!this.validateWhen()) {
54936
54936
  return;
54937
54937
  }
@@ -54978,7 +54978,7 @@ var List = class {
54978
54978
  subscribers.map((sub) => sub[0]),
54979
54979
  variables
54980
54980
  );
54981
- this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
54981
+ this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID, layer);
54982
54982
  for (const [spec] of subscribers) {
54983
54983
  spec.set(
54984
54984
  this.cache._internal_unstable.getSelection({
@@ -54991,12 +54991,12 @@ var List = class {
54991
54991
  }
54992
54992
  return true;
54993
54993
  }
54994
- remove(data, variables = {}) {
54994
+ remove(data, variables = {}, layer) {
54995
54995
  const targetID = this.cache._internal_unstable.id(this.listType(data), data);
54996
54996
  if (!targetID) {
54997
54997
  return;
54998
54998
  }
54999
- return this.removeID(targetID, variables);
54999
+ return this.removeID(targetID, variables, layer);
55000
55000
  }
55001
55001
  listType(data) {
55002
55002
  return data.__typename || this.type;
@@ -55028,7 +55028,7 @@ var List = class {
55028
55028
  layer,
55029
55029
  where
55030
55030
  }) {
55031
- if (!this.remove(data, variables)) {
55031
+ if (!this.remove(data, variables, layer)) {
55032
55032
  this.addToList(selection, data, variables, where, layer);
55033
55033
  }
55034
55034
  }
@@ -55165,7 +55165,7 @@ var StaleManager = class {
55165
55165
  // src/runtime/cache/storage.ts
55166
55166
  var InMemoryStorage = class {
55167
55167
  data;
55168
- idCount = 0;
55168
+ idCount = 1;
55169
55169
  rank = 0;
55170
55170
  constructor() {
55171
55171
  this.data = [];
@@ -55185,11 +55185,11 @@ var InMemoryStorage = class {
55185
55185
  insert(id, field, location, target) {
55186
55186
  return this.topLayer.insert(id, field, location, target);
55187
55187
  }
55188
- remove(id, field, target) {
55189
- return this.topLayer.remove(id, field, target);
55188
+ remove(id, field, target, layerToUser = this.topLayer) {
55189
+ return layerToUser.remove(id, field, target);
55190
55190
  }
55191
- delete(id) {
55192
- return this.topLayer.delete(id);
55191
+ delete(id, layerToUser = this.topLayer) {
55192
+ return layerToUser.delete(id);
55193
55193
  }
55194
55194
  deleteField(id, field) {
55195
55195
  return this.topLayer.deleteField(id, field);
@@ -55561,6 +55561,9 @@ var InMemorySubscriptions = class {
55561
55561
  subscribers = {};
55562
55562
  referenceCounts = {};
55563
55563
  keyVersions = {};
55564
+ activeFields(parent2) {
55565
+ return Object.keys(this.subscribers[parent2] || {});
55566
+ }
55564
55567
  add({
55565
55568
  parent: parent2,
55566
55569
  spec,
@@ -55829,20 +55832,7 @@ var Cache = class {
55829
55832
  }) {
55830
55833
  const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
55831
55834
  const subscribers = this._internal_unstable.writeSelection({ ...args, layer }).map((sub) => sub[0]);
55832
- const notified = [];
55833
- for (const spec of subscribers.concat(notifySubscribers)) {
55834
- if (!notified.includes(spec.set)) {
55835
- notified.push(spec.set);
55836
- spec.set(
55837
- this._internal_unstable.getSelection({
55838
- parent: spec.parentID || rootID,
55839
- selection: spec.selection,
55840
- variables: spec.variables?.() || {},
55841
- ignoreMasking: false
55842
- }).data
55843
- );
55844
- }
55845
- }
55835
+ this.#notifySubscribers(subscribers.concat(notifySubscribers));
55846
55836
  return subscribers;
55847
55837
  }
55848
55838
  read(...args) {
@@ -55881,10 +55871,10 @@ var Cache = class {
55881
55871
  }
55882
55872
  return handler;
55883
55873
  }
55884
- delete(id) {
55874
+ delete(id, layer) {
55885
55875
  this._internal_unstable.subscriptions.removeAllSubscribers(id);
55886
- this._internal_unstable.lists.removeIDFromAllLists(id);
55887
- this._internal_unstable.storage.delete(id);
55876
+ this._internal_unstable.lists.removeIDFromAllLists(id, layer);
55877
+ this._internal_unstable.storage.delete(id, layer);
55888
55878
  }
55889
55879
  setConfig(config2) {
55890
55880
  this._internal_unstable.setConfig(config2);
@@ -55916,6 +55906,70 @@ var Cache = class {
55916
55906
  config() {
55917
55907
  return this._internal_unstable.config;
55918
55908
  }
55909
+ clearLayer(layerID) {
55910
+ const layer = this._internal_unstable.storage.getLayer(layerID);
55911
+ if (!layer) {
55912
+ throw new Error("Cannot find layer with id: " + layerID);
55913
+ }
55914
+ const toNotify = [];
55915
+ const allFields = [];
55916
+ for (const target of [layer.fields, layer.links]) {
55917
+ for (const [id, fields] of Object.entries(target)) {
55918
+ allFields.push(
55919
+ ...Object.entries(fields).map(([field, value]) => ({ id, field, value }))
55920
+ );
55921
+ }
55922
+ }
55923
+ const displayFields = [];
55924
+ for (const pair of allFields) {
55925
+ const { displayLayers } = this._internal_unstable.storage.get(pair.id, pair.field);
55926
+ if (!displayLayers.includes(layerID)) {
55927
+ continue;
55928
+ }
55929
+ displayFields.push(pair);
55930
+ }
55931
+ for (const [id, operation] of Object.entries(layer.operations)) {
55932
+ if (operation.deleted) {
55933
+ displayFields.push(
55934
+ ...this._internal_unstable.subscriptions.activeFields(id).map((field) => ({ id, field }))
55935
+ );
55936
+ }
55937
+ const fields = Object.keys(operation.fields ?? {});
55938
+ if (fields.length > 0) {
55939
+ displayFields.push(...fields.map((field) => ({ id, field })));
55940
+ }
55941
+ }
55942
+ layer.clear();
55943
+ for (const display of displayFields) {
55944
+ const { field, id } = display;
55945
+ const notify = !("value" in display) || this._internal_unstable.storage.get(id, field).value !== display.value;
55946
+ if (notify) {
55947
+ toNotify.push(
55948
+ ...this._internal_unstable.subscriptions.get(id, field).map((sub) => sub[0])
55949
+ );
55950
+ }
55951
+ }
55952
+ this.#notifySubscribers(toNotify);
55953
+ }
55954
+ #notifySubscribers(subs) {
55955
+ if (subs.length === 0) {
55956
+ return;
55957
+ }
55958
+ const notified = [];
55959
+ for (const spec of subs) {
55960
+ if (!notified.includes(spec.set)) {
55961
+ notified.push(spec.set);
55962
+ spec.set(
55963
+ this._internal_unstable.getSelection({
55964
+ parent: spec.parentID || rootID,
55965
+ selection: spec.selection,
55966
+ variables: spec.variables?.() || {},
55967
+ ignoreMasking: false
55968
+ }).data
55969
+ );
55970
+ }
55971
+ }
55972
+ }
55919
55973
  };
55920
55974
  var CacheInternal = class {
55921
55975
  _disabled = false;
@@ -56203,8 +56257,16 @@ var CacheInternal = class {
56203
56257
  operation.position || "last",
56204
56258
  layer
56205
56259
  );
56260
+ } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
56261
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
56262
+ selection: fieldSelection,
56263
+ data: target,
56264
+ variables,
56265
+ where: operation.position || "last",
56266
+ layer
56267
+ });
56206
56268
  } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
56207
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
56269
+ this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables, layer);
56208
56270
  } else if (operation.action === "delete" && operation.type) {
56209
56271
  if (typeof target !== "string") {
56210
56272
  throw new Error("Cannot delete a record with a non-string ID");
@@ -56213,15 +56275,7 @@ var CacheInternal = class {
56213
56275
  if (!targetID) {
56214
56276
  continue;
56215
56277
  }
56216
- this.cache.delete(targetID);
56217
- } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
56218
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
56219
- selection: fieldSelection,
56220
- data: target,
56221
- variables,
56222
- where: operation.position || "last",
56223
- layer
56224
- });
56278
+ this.cache.delete(targetID, layer);
56225
56279
  }
56226
56280
  }
56227
56281
  }
@@ -56756,7 +56810,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
56756
56810
  var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56757
56811
  return {
56758
56812
  async start(ctx, { next, marshalVariables }) {
56759
- const layer = cache_default._internal_unstable.storage.createLayer(true);
56813
+ const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
56760
56814
  const optimisticResponse = ctx.stuff.optimisticResponse;
56761
56815
  let toNotify = [];
56762
56816
  if (optimisticResponse) {
@@ -56767,25 +56821,29 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56767
56821
  data: optimisticResponse
56768
56822
  }),
56769
56823
  variables: marshalVariables(ctx),
56770
- layer: layer.id
56824
+ layer: layerOptimistic.id
56771
56825
  });
56772
56826
  }
56773
56827
  ctx.cacheParams = {
56774
56828
  ...ctx.cacheParams,
56775
- layer,
56829
+ layer: layerOptimistic,
56776
56830
  notifySubscribers: toNotify,
56777
56831
  forceNotify: true
56778
56832
  };
56779
56833
  next(ctx);
56780
56834
  },
56781
56835
  afterNetwork(ctx, { resolve: resolve2 }) {
56782
- ctx.cacheParams?.layer?.clear();
56836
+ if (ctx.cacheParams?.layer) {
56837
+ cache_default.clearLayer(ctx.cacheParams.layer.id);
56838
+ }
56783
56839
  resolve2(ctx);
56784
56840
  },
56785
56841
  end(ctx, { resolve: resolve2, value }) {
56786
56842
  const hasErrors = value.errors && value.errors.length > 0;
56787
56843
  if (hasErrors) {
56788
- ctx.cacheParams?.layer?.clear();
56844
+ if (ctx.cacheParams?.layer) {
56845
+ cache_default.clearLayer(ctx.cacheParams.layer.id);
56846
+ }
56789
56847
  }
56790
56848
  if (ctx.cacheParams?.layer) {
56791
56849
  cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
@@ -56795,7 +56853,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56795
56853
  catch(ctx, { error }) {
56796
56854
  if (ctx.cacheParams?.layer) {
56797
56855
  const { layer } = ctx.cacheParams;
56798
- layer.clear();
56856
+ cache_default.clearLayer(layer.id);
56799
56857
  cache_default._internal_unstable.storage.resolveLayer(layer.id);
56800
56858
  }
56801
56859
  throw error;
@@ -57685,18 +57743,14 @@ function flattenSelections({
57685
57743
  filepath,
57686
57744
  selections,
57687
57745
  fragmentDefinitions,
57688
- ignoreMaskDisable,
57689
- keepFragmentSpreadNodes,
57690
- hoistFragments
57746
+ applyFragments
57691
57747
  }) {
57692
57748
  const fields = new FieldCollection({
57693
57749
  config: config2,
57694
57750
  filepath,
57695
57751
  selections,
57696
57752
  fragmentDefinitions,
57697
- ignoreMaskDisable: !!ignoreMaskDisable,
57698
- keepFragmentSpreadNodes: !!keepFragmentSpreadNodes,
57699
- hoistFragments
57753
+ applyFragments: !!applyFragments
57700
57754
  });
57701
57755
  return fields.toSelectionSet();
57702
57756
  }
@@ -57707,18 +57761,14 @@ var FieldCollection = class {
57707
57761
  fields;
57708
57762
  inlineFragments;
57709
57763
  fragmentSpreads;
57710
- ignoreMaskDisable;
57711
- keepFragmentSpreadNodes;
57712
- hoistFragments;
57764
+ applyFragments;
57713
57765
  constructor(args) {
57714
57766
  this.config = args.config;
57715
57767
  this.fragmentDefinitions = args.fragmentDefinitions;
57716
- this.ignoreMaskDisable = args.ignoreMaskDisable;
57717
- this.keepFragmentSpreadNodes = args.keepFragmentSpreadNodes;
57768
+ this.applyFragments = args.applyFragments;
57718
57769
  this.fields = {};
57719
57770
  this.inlineFragments = {};
57720
57771
  this.fragmentSpreads = {};
57721
- this.hoistFragments = !!args.hoistFragments;
57722
57772
  this.filepath = args.filepath;
57723
57773
  for (const selection of args.selections) {
57724
57774
  this.add({ selection });
@@ -57728,21 +57778,18 @@ var FieldCollection = class {
57728
57778
  return Object.keys(this.fields).length + Object.keys(this.inlineFragments).length + Object.keys(this.fragmentSpreads).length;
57729
57779
  }
57730
57780
  add({ selection, external }) {
57731
- let includeFragments = this.config.defaultFragmentMasking === "disable";
57781
+ let include = this.config.defaultFragmentMasking === "disable";
57732
57782
  const maskEnableDirective = selection.directives?.find(
57733
57783
  ({ name }) => name.value === this.config.maskEnableDirective
57734
57784
  );
57735
57785
  if (maskEnableDirective) {
57736
- includeFragments = false;
57786
+ include = false;
57737
57787
  }
57738
57788
  const maskDisableDirective = selection.directives?.find(
57739
57789
  ({ name }) => name.value === this.config.maskDisableDirective
57740
57790
  );
57741
57791
  if (maskDisableDirective) {
57742
- includeFragments = true;
57743
- }
57744
- if (this.ignoreMaskDisable) {
57745
- includeFragments = true;
57792
+ include = true;
57746
57793
  }
57747
57794
  if (selection.kind === "Field") {
57748
57795
  const key = selection.alias?.value || selection.name.value;
@@ -57758,7 +57805,7 @@ var FieldCollection = class {
57758
57805
  external
57759
57806
  });
57760
57807
  }
57761
- if (!external && includeFragments) {
57808
+ if (this.applyFragments && !external) {
57762
57809
  this.fields[key].selection.fragmentSpreads = {
57763
57810
  ...this.collectFragmentSpreads(selection.selectionSet?.selections ?? []),
57764
57811
  ...this.fields[key].selection.fragmentSpreads
@@ -57772,16 +57819,13 @@ var FieldCollection = class {
57772
57819
  }
57773
57820
  }
57774
57821
  if (selection.kind === "InlineFragment" && selection.typeCondition) {
57775
- this.walkInlineFragment({ selection, external, hoistFragments: this.hoistFragments });
57822
+ this.walkInlineFragment({ selection, external });
57776
57823
  return;
57777
57824
  }
57778
57825
  if (selection.kind === "FragmentSpread") {
57779
- if (this.keepFragmentSpreadNodes && !external) {
57826
+ if (!external || include) {
57780
57827
  this.fragmentSpreads[selection.name.value] = selection;
57781
57828
  }
57782
- if (!includeFragments) {
57783
- return;
57784
- }
57785
57829
  const definition = this.fragmentDefinitions[selection.name.value];
57786
57830
  if (!definition) {
57787
57831
  throw new HoudiniError({
@@ -57789,23 +57833,25 @@ var FieldCollection = class {
57789
57833
  message: "Could not find referenced fragment definition: " + selection.name.value + "\n" + JSON.stringify(Object.keys(this.fragmentDefinitions), null, 4)
57790
57834
  });
57791
57835
  }
57792
- this.add({
57793
- selection: {
57794
- kind: "InlineFragment",
57795
- typeCondition: {
57796
- kind: "NamedType",
57797
- name: {
57798
- kind: "Name",
57799
- value: definition.typeCondition.name.value
57836
+ if (this.applyFragments || include) {
57837
+ this.add({
57838
+ selection: {
57839
+ kind: "InlineFragment",
57840
+ typeCondition: {
57841
+ kind: "NamedType",
57842
+ name: {
57843
+ kind: "Name",
57844
+ value: definition.typeCondition.name.value
57845
+ }
57846
+ },
57847
+ selectionSet: {
57848
+ kind: "SelectionSet",
57849
+ selections: [...definition.selectionSet.selections]
57800
57850
  }
57801
57851
  },
57802
- selectionSet: {
57803
- kind: "SelectionSet",
57804
- selections: [...definition.selectionSet.selections]
57805
- }
57806
- },
57807
- external
57808
- });
57852
+ external: !include
57853
+ });
57854
+ }
57809
57855
  }
57810
57856
  }
57811
57857
  collectFragmentSpreads(selections, result = {}) {
@@ -57862,8 +57908,7 @@ var FieldCollection = class {
57862
57908
  }
57863
57909
  walkInlineFragment({
57864
57910
  selection,
57865
- external,
57866
- hoistFragments
57911
+ external
57867
57912
  }) {
57868
57913
  const key = selection.typeCondition.name.value;
57869
57914
  if (!this.inlineFragments[key]) {
@@ -57873,7 +57918,7 @@ var FieldCollection = class {
57873
57918
  };
57874
57919
  }
57875
57920
  for (const subselect of selection.selectionSet.selections || []) {
57876
- if (subselect.kind === "FragmentSpread" && !hoistFragments || subselect.kind === "Field" || subselect.kind === "InlineFragment" && !subselect.typeCondition) {
57921
+ if (subselect.kind === "Field" || subselect.kind === "InlineFragment" && !subselect.typeCondition) {
57877
57922
  this.inlineFragments[key].selection.add({
57878
57923
  selection: subselect,
57879
57924
  external
@@ -57882,11 +57927,11 @@ var FieldCollection = class {
57882
57927
  } else if (subselect.kind === "FragmentSpread") {
57883
57928
  this.add({
57884
57929
  selection: subselect,
57885
- external: true
57930
+ external
57886
57931
  });
57887
57932
  continue;
57888
57933
  } else {
57889
- this.walkInlineFragment({ selection: subselect, external, hoistFragments });
57934
+ this.walkInlineFragment({ selection: subselect, external });
57890
57935
  }
57891
57936
  }
57892
57937
  }
@@ -57896,9 +57941,7 @@ var FieldCollection = class {
57896
57941
  fragmentDefinitions: this.fragmentDefinitions,
57897
57942
  selections: [],
57898
57943
  filepath: this.filepath,
57899
- ignoreMaskDisable: this.ignoreMaskDisable,
57900
- keepFragmentSpreadNodes: this.keepFragmentSpreadNodes,
57901
- hoistFragments: this.hoistFragments
57944
+ applyFragments: this.applyFragments
57902
57945
  });
57903
57946
  }
57904
57947
  };
@@ -58827,7 +58870,7 @@ function operationObject({
58827
58870
  if (operationKind === "insert" || operationKind === "toggle") {
58828
58871
  operation.position = position;
58829
58872
  }
58830
- if (operationKind === "insert" && allLists) {
58873
+ if (allLists && operationKind !== "delete") {
58831
58874
  operation.target = "all";
58832
58875
  }
58833
58876
  if (parentID) {
@@ -59818,7 +59861,8 @@ function prepareSelection({
59818
59861
  inConnection,
59819
59862
  typeMap,
59820
59863
  abstractTypes,
59821
- globalLoading
59864
+ globalLoading,
59865
+ includeFragments
59822
59866
  }) {
59823
59867
  let object = {};
59824
59868
  const loadingTypes = [];
@@ -59838,7 +59882,8 @@ function prepareSelection({
59838
59882
  document,
59839
59883
  typeMap,
59840
59884
  abstractTypes,
59841
- globalLoading
59885
+ globalLoading,
59886
+ includeFragments
59842
59887
  }).fields || {}
59843
59888
  );
59844
59889
  } else {
@@ -59886,7 +59931,8 @@ function prepareSelection({
59886
59931
  document,
59887
59932
  typeMap,
59888
59933
  abstractTypes,
59889
- globalLoading
59934
+ globalLoading,
59935
+ includeFragments
59890
59936
  }).fields
59891
59937
  };
59892
59938
  if (field.directives?.find((d) => d.name.value === config2.loadingDirective)) {
@@ -60004,7 +60050,8 @@ function prepareSelection({
60004
60050
  inConnection: connectionState,
60005
60051
  typeMap,
60006
60052
  abstractTypes,
60007
- globalLoading: forceLoading
60053
+ globalLoading: forceLoading,
60054
+ includeFragments
60008
60055
  });
60009
60056
  if (Object.values(fieldObj.selection.fields ?? {}).some((field2) => field2.required)) {
60010
60057
  fieldObj.nullable = true;
@@ -60337,14 +60384,13 @@ function artifactGenerator(stats) {
60337
60384
  document: doc,
60338
60385
  rootType,
60339
60386
  globalLoading,
60387
+ includeFragments: doc.kind !== ArtifactKind.Fragment,
60340
60388
  selections: flattenSelections({
60341
60389
  config: config2,
60342
60390
  filepath: doc.filename,
60343
60391
  selections: selectionSet.selections,
60344
60392
  fragmentDefinitions,
60345
- ignoreMaskDisable: docKind !== "HoudiniFragment",
60346
- keepFragmentSpreadNodes: true,
60347
- hoistFragments: true
60393
+ applyFragments: doc.kind !== ArtifactKind.Fragment
60348
60394
  }),
60349
60395
  operations: operationsByPath(
60350
60396
  config2,
@@ -61309,8 +61355,7 @@ async function generateDocumentTypes(config2, docs) {
61309
61355
  config: config2,
61310
61356
  filepath: filename,
61311
61357
  selections: definition.selectionSet.selections,
61312
- fragmentDefinitions,
61313
- keepFragmentSpreadNodes: true
61358
+ fragmentDefinitions
61314
61359
  });
61315
61360
  if (definition?.kind === "OperationDefinition") {
61316
61361
  await generateOperationTypeDefs(