houdini 1.0.0-next.7 → 1.0.0-next.9

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 (100) hide show
  1. package/build/cmd-cjs/index.js +93 -66
  2. package/build/cmd-esm/index.js +66 -39
  3. package/build/codegen/generators/typescript/typeReference.d.ts +4 -2
  4. package/build/codegen/generators/typescript/types.d.ts +0 -1
  5. package/build/codegen-cjs/index.js +67 -39
  6. package/build/codegen-esm/index.js +54 -26
  7. package/build/lib/config.d.ts +2 -1
  8. package/build/lib/path.d.ts +1 -1
  9. package/build/lib-cjs/index.js +40 -37
  10. package/build/lib-esm/index.js +14 -11
  11. package/build/runtime/cache/cache.d.ts +6 -6
  12. package/build/runtime/cache/storage.d.ts +5 -5
  13. package/build/runtime/cache/stuff.d.ts +0 -2
  14. package/build/runtime/client/documentStore.d.ts +4 -3
  15. package/build/runtime/client/index.d.ts +6 -5
  16. package/build/runtime/client/plugins/cache.d.ts +1 -1
  17. package/build/runtime/client/plugins/fetch.d.ts +1 -1
  18. package/build/runtime/client/plugins/fetchParams.d.ts +1 -1
  19. package/build/runtime/client/plugins/injectedPlugins.d.ts +2 -1
  20. package/build/runtime/client/plugins/mutation.d.ts +1 -1
  21. package/build/runtime/client/plugins/query.d.ts +1 -1
  22. package/build/runtime/client/plugins/subscription.d.ts +1 -1
  23. package/build/runtime/client/plugins/throwOnError.d.ts +1 -1
  24. package/build/runtime/client/utils/documentPlugins.d.ts +2 -2
  25. package/build/runtime/lib/flatten.d.ts +2 -0
  26. package/build/runtime/lib/types.d.ts +2 -0
  27. package/build/runtime/public/record.d.ts +1 -2
  28. package/build/runtime-cjs/cache/cache.d.ts +6 -6
  29. package/build/runtime-cjs/cache/cache.js +6 -5
  30. package/build/runtime-cjs/cache/lists.js +3 -3
  31. package/build/runtime-cjs/cache/storage.d.ts +5 -5
  32. package/build/runtime-cjs/cache/storage.js +2 -2
  33. package/build/runtime-cjs/cache/stuff.d.ts +0 -2
  34. package/build/runtime-cjs/cache/stuff.js +2 -19
  35. package/build/runtime-cjs/cache/subscription.js +5 -4
  36. package/build/runtime-cjs/client/documentStore.d.ts +4 -3
  37. package/build/runtime-cjs/client/documentStore.js +4 -4
  38. package/build/runtime-cjs/client/index.d.ts +6 -5
  39. package/build/runtime-cjs/client/index.js +45 -19
  40. package/build/runtime-cjs/client/plugins/cache.d.ts +1 -1
  41. package/build/runtime-cjs/client/plugins/cache.js +3 -3
  42. package/build/runtime-cjs/client/plugins/fetch.d.ts +1 -1
  43. package/build/runtime-cjs/client/plugins/fetch.js +7 -7
  44. package/build/runtime-cjs/client/plugins/fetchParams.d.ts +1 -1
  45. package/build/runtime-cjs/client/plugins/fetchParams.js +3 -3
  46. package/build/runtime-cjs/client/plugins/injectedPlugins.d.ts +2 -1
  47. package/build/runtime-cjs/client/plugins/mutation.d.ts +1 -1
  48. package/build/runtime-cjs/client/plugins/mutation.js +3 -3
  49. package/build/runtime-cjs/client/plugins/query.d.ts +1 -1
  50. package/build/runtime-cjs/client/plugins/query.js +3 -3
  51. package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -1
  52. package/build/runtime-cjs/client/plugins/subscription.js +3 -3
  53. package/build/runtime-cjs/client/plugins/throwOnError.d.ts +1 -1
  54. package/build/runtime-cjs/client/plugins/throwOnError.js +3 -3
  55. package/build/runtime-cjs/client/utils/documentPlugins.d.ts +2 -2
  56. package/build/runtime-cjs/lib/flatten.d.ts +2 -0
  57. package/build/runtime-cjs/lib/flatten.js +41 -0
  58. package/build/runtime-cjs/lib/types.d.ts +2 -0
  59. package/build/runtime-cjs/public/cache.js +2 -2
  60. package/build/runtime-cjs/public/record.d.ts +1 -2
  61. package/build/runtime-cjs/public/record.js +1 -2
  62. package/build/runtime-esm/cache/cache.d.ts +6 -6
  63. package/build/runtime-esm/cache/cache.js +7 -6
  64. package/build/runtime-esm/cache/lists.js +3 -3
  65. package/build/runtime-esm/cache/storage.d.ts +5 -5
  66. package/build/runtime-esm/cache/storage.js +2 -2
  67. package/build/runtime-esm/cache/stuff.d.ts +0 -2
  68. package/build/runtime-esm/cache/stuff.js +1 -17
  69. package/build/runtime-esm/cache/subscription.js +6 -5
  70. package/build/runtime-esm/client/documentStore.d.ts +4 -3
  71. package/build/runtime-esm/client/documentStore.js +5 -5
  72. package/build/runtime-esm/client/index.d.ts +6 -5
  73. package/build/runtime-esm/client/index.js +46 -21
  74. package/build/runtime-esm/client/plugins/cache.d.ts +1 -1
  75. package/build/runtime-esm/client/plugins/cache.js +2 -2
  76. package/build/runtime-esm/client/plugins/fetch.d.ts +1 -1
  77. package/build/runtime-esm/client/plugins/fetch.js +6 -6
  78. package/build/runtime-esm/client/plugins/fetchParams.d.ts +1 -1
  79. package/build/runtime-esm/client/plugins/fetchParams.js +2 -2
  80. package/build/runtime-esm/client/plugins/injectedPlugins.d.ts +2 -1
  81. package/build/runtime-esm/client/plugins/mutation.d.ts +1 -1
  82. package/build/runtime-esm/client/plugins/mutation.js +2 -2
  83. package/build/runtime-esm/client/plugins/query.d.ts +1 -1
  84. package/build/runtime-esm/client/plugins/query.js +2 -2
  85. package/build/runtime-esm/client/plugins/subscription.d.ts +1 -1
  86. package/build/runtime-esm/client/plugins/subscription.js +2 -2
  87. package/build/runtime-esm/client/plugins/throwOnError.d.ts +1 -1
  88. package/build/runtime-esm/client/plugins/throwOnError.js +2 -2
  89. package/build/runtime-esm/client/utils/documentPlugins.d.ts +2 -2
  90. package/build/runtime-esm/lib/flatten.d.ts +2 -0
  91. package/build/runtime-esm/lib/flatten.js +17 -0
  92. package/build/runtime-esm/lib/types.d.ts +2 -0
  93. package/build/runtime-esm/public/cache.js +2 -2
  94. package/build/runtime-esm/public/record.d.ts +1 -2
  95. package/build/runtime-esm/public/record.js +1 -2
  96. package/build/test-cjs/index.js +67 -39
  97. package/build/test-esm/index.js +54 -26
  98. package/build/vite-cjs/index.js +90 -58
  99. package/build/vite-esm/index.js +64 -32
  100. package/package.json +4 -4
@@ -7495,7 +7495,7 @@ var require_definition = __commonJS({
7495
7495
  exports.assertInterfaceType = assertInterfaceType;
7496
7496
  exports.isUnionType = isUnionType13;
7497
7497
  exports.assertUnionType = assertUnionType;
7498
- exports.isEnumType = isEnumType10;
7498
+ exports.isEnumType = isEnumType11;
7499
7499
  exports.assertEnumType = assertEnumType;
7500
7500
  exports.isInputObjectType = isInputObjectType8;
7501
7501
  exports.assertInputObjectType = assertInputObjectType;
@@ -7566,7 +7566,7 @@ var require_definition = __commonJS({
7566
7566
  return Constructor;
7567
7567
  }
7568
7568
  function isType(type) {
7569
- return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
7569
+ return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
7570
7570
  }
7571
7571
  function assertType(type) {
7572
7572
  if (!isType(type)) {
@@ -7610,11 +7610,11 @@ var require_definition = __commonJS({
7610
7610
  }
7611
7611
  return type;
7612
7612
  }
7613
- function isEnumType10(type) {
7613
+ function isEnumType11(type) {
7614
7614
  return (0, _instanceOf.default)(type, GraphQLEnumType4);
7615
7615
  }
7616
7616
  function assertEnumType(type) {
7617
- if (!isEnumType10(type)) {
7617
+ if (!isEnumType11(type)) {
7618
7618
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
7619
7619
  }
7620
7620
  return type;
@@ -7647,7 +7647,7 @@ var require_definition = __commonJS({
7647
7647
  return type;
7648
7648
  }
7649
7649
  function isInputType(type) {
7650
- return isScalarType13(type) || isEnumType10(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
7650
+ return isScalarType13(type) || isEnumType11(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
7651
7651
  }
7652
7652
  function assertInputType(type) {
7653
7653
  if (!isInputType(type)) {
@@ -7656,7 +7656,7 @@ var require_definition = __commonJS({
7656
7656
  return type;
7657
7657
  }
7658
7658
  function isOutputType(type) {
7659
- return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isWrappingType(type) && isOutputType(type.ofType);
7659
+ return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isWrappingType(type) && isOutputType(type.ofType);
7660
7660
  }
7661
7661
  function assertOutputType(type) {
7662
7662
  if (!isOutputType(type)) {
@@ -7665,7 +7665,7 @@ var require_definition = __commonJS({
7665
7665
  return type;
7666
7666
  }
7667
7667
  function isLeafType4(type) {
7668
- return isScalarType13(type) || isEnumType10(type);
7668
+ return isScalarType13(type) || isEnumType11(type);
7669
7669
  }
7670
7670
  function assertLeafType(type) {
7671
7671
  if (!isLeafType4(type)) {
@@ -7753,7 +7753,7 @@ var require_definition = __commonJS({
7753
7753
  }
7754
7754
  }
7755
7755
  function isNamedType4(type) {
7756
- return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type);
7756
+ return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isInputObjectType8(type);
7757
7757
  }
7758
7758
  function assertNamedType(type) {
7759
7759
  if (!isNamedType4(type)) {
@@ -65185,7 +65185,7 @@ function mergeSchemas(config4) {
65185
65185
  // src/lib/config.ts
65186
65186
  var graphql2 = __toESM(require_graphql2(), 1);
65187
65187
  var import_minimatch = __toESM(require_minimatch(), 1);
65188
- var import_url = require("url");
65188
+ var import_node_url2 = require("node:url");
65189
65189
 
65190
65190
  // src/runtime/lib/config.ts
65191
65191
  function defaultConfigValues(file) {
@@ -65288,10 +65288,10 @@ __export(fs_exports, {
65288
65288
  writeFile: () => writeFile
65289
65289
  });
65290
65290
  var import_fs_extra = __toESM(require_lib(), 1);
65291
- var import_promises = __toESM(require("fs/promises"), 1);
65292
65291
  var import_glob = __toESM(require_glob(), 1);
65293
65292
  var import_memfs = __toESM(require_lib2(), 1);
65294
- var import_util = require("util");
65293
+ var import_promises = __toESM(require("node:fs/promises"), 1);
65294
+ var import_node_util = require("node:util");
65295
65295
 
65296
65296
  // src/lib/path.ts
65297
65297
  var path_exports = {};
@@ -65308,36 +65308,36 @@ __export(path_exports, {
65308
65308
  resolve: () => resolve,
65309
65309
  sep: () => sep
65310
65310
  });
65311
- var import_os = __toESM(require("os"), 1);
65312
- var import_path = __toESM(require("path"), 1);
65311
+ var import_node_os = __toESM(require("node:os"), 1);
65312
+ var import_node_path = __toESM(require("node:path"), 1);
65313
65313
  var sep = "/";
65314
65314
  function resolve(...parts) {
65315
- return posixify(import_path.default.resolve(...parts));
65315
+ return posixify(import_node_path.default.resolve(...parts));
65316
65316
  }
65317
65317
  function join2(...parts) {
65318
- return posixify(import_path.default.join(...parts));
65318
+ return posixify(import_node_path.default.join(...parts));
65319
65319
  }
65320
65320
  function extname(target) {
65321
- return import_path.default.extname(target);
65321
+ return import_node_path.default.extname(target);
65322
65322
  }
65323
65323
  function relative(from, to) {
65324
- return posixify(import_path.default.relative(from, to));
65324
+ return posixify(import_node_path.default.relative(from, to));
65325
65325
  }
65326
65326
  function basename(target) {
65327
- return import_path.default.basename(target);
65327
+ return import_node_path.default.basename(target);
65328
65328
  }
65329
65329
  function dirname(target) {
65330
- return import_path.default.dirname(target);
65330
+ return import_node_path.default.dirname(target);
65331
65331
  }
65332
65332
  function isAbsolute(target) {
65333
- return import_path.default.isAbsolute(target);
65333
+ return import_node_path.default.isAbsolute(target);
65334
65334
  }
65335
65335
  function parse2(target) {
65336
- return import_path.default.parse(target);
65336
+ return import_node_path.default.parse(target);
65337
65337
  }
65338
65338
  var posixify = (str) => str.replace(/\\/g, "/");
65339
65339
  function importPath(target) {
65340
- return ["win32", "win64"].includes(import_os.default.platform()) ? "file:///" + target : target;
65340
+ return ["win32", "win64"].includes(import_node_os.default.platform()) ? "file:///" + target : target;
65341
65341
  }
65342
65342
 
65343
65343
  // src/lib/fs.ts
@@ -65461,7 +65461,7 @@ async function rmdir(filepath) {
65461
65461
  recursive: true
65462
65462
  });
65463
65463
  }
65464
- return await (0, import_util.promisify)(import_memfs.fs.rmdir)(filepath);
65464
+ return await (0, import_node_util.promisify)(import_memfs.fs.rmdir)(filepath);
65465
65465
  }
65466
65466
  async function stat(filepath) {
65467
65467
  if (!houdini_mode.is_testing) {
@@ -65539,7 +65539,7 @@ async function recursiveCopy(source, target, transforms, notRoot) {
65539
65539
  }
65540
65540
  }
65541
65541
  async function glob(pattern) {
65542
- return await (0, import_util.promisify)(import_glob.glob)(posixify(pattern));
65542
+ return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
65543
65543
  }
65544
65544
  glob.hasMagic = import_glob.glob.hasMagic;
65545
65545
 
@@ -65594,7 +65594,7 @@ var dist_default = dataUriToBuffer;
65594
65594
 
65595
65595
  // ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/body.js
65596
65596
  var import_node_stream = __toESM(require("node:stream"), 1);
65597
- var import_node_util = require("node:util");
65597
+ var import_node_util2 = require("node:util");
65598
65598
  var import_node_buffer = require("node:buffer");
65599
65599
  init_fetch_blob();
65600
65600
  init_esm_min();
@@ -65648,7 +65648,7 @@ var isSameProtocol = (destination, original) => {
65648
65648
  };
65649
65649
 
65650
65650
  // ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/body.js
65651
- var pipeline = (0, import_node_util.promisify)(import_node_stream.default.pipeline);
65651
+ var pipeline = (0, import_node_util2.promisify)(import_node_stream.default.pipeline);
65652
65652
  var INTERNALS = Symbol("Body internals");
65653
65653
  var Body = class {
65654
65654
  constructor(body, {
@@ -65661,7 +65661,7 @@ var Body = class {
65661
65661
  body = import_node_buffer.Buffer.from(body.toString());
65662
65662
  } else if (isBlob(body)) {
65663
65663
  } else if (import_node_buffer.Buffer.isBuffer(body)) {
65664
- } else if (import_node_util.types.isAnyArrayBuffer(body)) {
65664
+ } else if (import_node_util2.types.isAnyArrayBuffer(body)) {
65665
65665
  body = import_node_buffer.Buffer.from(body);
65666
65666
  } else if (ArrayBuffer.isView(body)) {
65667
65667
  body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
@@ -65735,7 +65735,7 @@ var Body = class {
65735
65735
  return consumeBody(this);
65736
65736
  }
65737
65737
  };
65738
- Body.prototype.buffer = (0, import_node_util.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer");
65738
+ Body.prototype.buffer = (0, import_node_util2.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer");
65739
65739
  Object.defineProperties(Body.prototype, {
65740
65740
  body: { enumerable: true },
65741
65741
  bodyUsed: { enumerable: true },
@@ -65743,7 +65743,7 @@ Object.defineProperties(Body.prototype, {
65743
65743
  blob: { enumerable: true },
65744
65744
  json: { enumerable: true },
65745
65745
  text: { enumerable: true },
65746
- data: { get: (0, import_node_util.deprecate)(
65746
+ data: { get: (0, import_node_util2.deprecate)(
65747
65747
  () => {
65748
65748
  },
65749
65749
  "data doesn't exist, use json(), text(), arrayBuffer(), or body instead",
@@ -65811,7 +65811,7 @@ var clone = (instance, highWaterMark) => {
65811
65811
  }
65812
65812
  return body;
65813
65813
  };
65814
- var getNonSpecFormDataBoundary = (0, import_node_util.deprecate)(
65814
+ var getNonSpecFormDataBoundary = (0, import_node_util2.deprecate)(
65815
65815
  (body) => body.getBoundary(),
65816
65816
  "form-data doesn't follow the spec and requires special treatment. Use alternative package",
65817
65817
  "https://github.com/node-fetch/node-fetch/issues/1167"
@@ -65829,7 +65829,7 @@ var extractContentType = (body, request) => {
65829
65829
  if (isBlob(body)) {
65830
65830
  return body.type || null;
65831
65831
  }
65832
- if (import_node_buffer.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
65832
+ if (import_node_buffer.Buffer.isBuffer(body) || import_node_util2.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
65833
65833
  return null;
65834
65834
  }
65835
65835
  if (body instanceof FormData) {
@@ -65868,7 +65868,7 @@ var writeToStream = async (dest, { body }) => {
65868
65868
  };
65869
65869
 
65870
65870
  // ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/headers.js
65871
- var import_node_util2 = require("node:util");
65871
+ var import_node_util3 = require("node:util");
65872
65872
  var import_node_http = __toESM(require("node:http"), 1);
65873
65873
  var validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (name) => {
65874
65874
  if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
@@ -65893,7 +65893,7 @@ var Headers = class extends URLSearchParams {
65893
65893
  result.push(...values.map((value) => [name, value]));
65894
65894
  }
65895
65895
  } else if (init == null) {
65896
- } else if (typeof init === "object" && !import_node_util2.types.isBoxedPrimitive(init)) {
65896
+ } else if (typeof init === "object" && !import_node_util3.types.isBoxedPrimitive(init)) {
65897
65897
  const method = init[Symbol.iterator];
65898
65898
  if (method == null) {
65899
65899
  result.push(...Object.entries(init));
@@ -65902,7 +65902,7 @@ var Headers = class extends URLSearchParams {
65902
65902
  throw new TypeError("Header pairs must be iterable");
65903
65903
  }
65904
65904
  result = [...init].map((pair) => {
65905
- if (typeof pair !== "object" || import_node_util2.types.isBoxedPrimitive(pair)) {
65905
+ if (typeof pair !== "object" || import_node_util3.types.isBoxedPrimitive(pair)) {
65906
65906
  throw new TypeError("Each header pair must be an iterable object");
65907
65907
  }
65908
65908
  return [...pair];
@@ -66149,7 +66149,7 @@ Object.defineProperties(Response.prototype, {
66149
66149
 
66150
66150
  // ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/request.js
66151
66151
  var import_node_url = require("node:url");
66152
- var import_node_util3 = require("node:util");
66152
+ var import_node_util4 = require("node:util");
66153
66153
 
66154
66154
  // ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/utils/get-search.js
66155
66155
  var getSearch = (parsedURL) => {
@@ -66306,7 +66306,7 @@ var INTERNALS3 = Symbol("Request internals");
66306
66306
  var isRequest = (object) => {
66307
66307
  return typeof object === "object" && typeof object[INTERNALS3] === "object";
66308
66308
  };
66309
- var doBadDataWarn = (0, import_node_util3.deprecate)(
66309
+ var doBadDataWarn = (0, import_node_util4.deprecate)(
66310
66310
  () => {
66311
66311
  },
66312
66312
  ".data is not a valid RequestInit property, use .body instead",
@@ -66810,7 +66810,7 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
66810
66810
 
66811
66811
  // src/lib/config.ts
66812
66812
  var import_meta = {};
66813
- var currentDir = global.__dirname || dirname((0, import_url.fileURLToPath)(import_meta.url));
66813
+ var currentDir = global.__dirname || dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
66814
66814
  var Config = class {
66815
66815
  filepath;
66816
66816
  rootDir;
@@ -67301,13 +67301,16 @@ var pendingConfigPromise = null;
67301
67301
  async function getConfig({
67302
67302
  configPath = DEFAULT_CONFIG_PATH,
67303
67303
  noSchema,
67304
+ forceReload,
67304
67305
  ...extraConfig
67305
67306
  } = {}) {
67306
- if (_config) {
67307
- return _config;
67308
- }
67309
- if (pendingConfigPromise) {
67310
- return await pendingConfigPromise;
67307
+ if (!forceReload) {
67308
+ if (_config) {
67309
+ return _config;
67310
+ }
67311
+ if (pendingConfigPromise) {
67312
+ return await pendingConfigPromise;
67313
+ }
67311
67314
  }
67312
67315
  let resolve2 = () => {
67313
67316
  };
@@ -67325,7 +67328,7 @@ async function getConfig({
67325
67328
  if (!pluginName.startsWith(".")) {
67326
67329
  pluginFile = await pluginPath(pluginName, configPath);
67327
67330
  }
67328
- const { default: pluginInit } = await import((0, import_url.pathToFileURL)(pluginFile).toString());
67331
+ const { default: pluginInit } = await import((0, import_node_url2.pathToFileURL)(pluginFile).toString());
67329
67332
  if (!pluginInit.plugin || !pluginInit.name) {
67330
67333
  throw new HoudiniError({
67331
67334
  filepath: pluginFile,
@@ -67502,8 +67505,8 @@ async function loadSchemaFile(schemaPath) {
67502
67505
  }
67503
67506
 
67504
67507
  // src/lib/graphql.ts
67505
- var import_crypto = __toESM(require("crypto"), 1);
67506
67508
  var graphql3 = __toESM(require_graphql2(), 1);
67509
+ var import_node_crypto = __toESM(require("node:crypto"), 1);
67507
67510
  function getRootType(type) {
67508
67511
  if (graphql3.isNonNullType(type)) {
67509
67512
  return getRootType(type.ofType);
@@ -67517,7 +67520,7 @@ function hashDocument({
67517
67520
  document
67518
67521
  }) {
67519
67522
  const docString = typeof document === "string" ? document : document.artifact?.raw;
67520
- return import_crypto.default.createHash("sha256").update(docString ?? "").digest("hex");
67523
+ return import_node_crypto.default.createHash("sha256").update(docString ?? "").digest("hex");
67521
67524
  }
67522
67525
  function parentTypeFromAncestors(schema, filepath, ancestors) {
67523
67526
  const parents = [...ancestors];
@@ -70464,11 +70467,13 @@ function scalarPropertyValue(config4, missingScalars, target) {
70464
70467
 
70465
70468
  // src/codegen/generators/typescript/typeReference.ts
70466
70469
  var AST8 = recast8.types.builders;
70467
- function tsTypeReference(config4, missingScalars, definition) {
70470
+ function tsTypeReference(config4, missingScalars, definition, body) {
70468
70471
  const { type, wrappers } = unwrapType(config4, definition.type);
70469
70472
  let result;
70470
70473
  if (graphql16.isScalarType(type)) {
70471
70474
  result = scalarPropertyValue(config4, missingScalars, type);
70475
+ } else if (graphql16.isEnumType(type)) {
70476
+ result = enumReference(config4, body, type.name);
70472
70477
  } else {
70473
70478
  result = AST8.tsTypeReference(AST8.identifier(type.name));
70474
70479
  }
@@ -70483,6 +70488,19 @@ function tsTypeReference(config4, missingScalars, definition) {
70483
70488
  }
70484
70489
  return result;
70485
70490
  }
70491
+ function enumReference(config4, body, name) {
70492
+ ensureImports({
70493
+ config: config4,
70494
+ body,
70495
+ import: ["ValueOf"],
70496
+ importKind: "type",
70497
+ sourceModule: "$houdini/runtime/lib/types"
70498
+ });
70499
+ return AST8.tsTypeReference(
70500
+ AST8.identifier("ValueOf"),
70501
+ AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
70502
+ );
70503
+ }
70486
70504
 
70487
70505
  // src/codegen/generators/typescript/addReferencedInputTypes.ts
70488
70506
  var AST9 = recast9.types.builders;
@@ -70514,7 +70532,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
70514
70532
  members.push(
70515
70533
  AST9.tsPropertySignature(
70516
70534
  AST9.identifier(field.name),
70517
- AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field)),
70535
+ AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field, body)),
70518
70536
  graphql17.isNullableType(field.type)
70519
70537
  )
70520
70538
  );
@@ -70545,6 +70563,13 @@ function inlineType({
70545
70563
  if (graphql18.isScalarType(type)) {
70546
70564
  result = scalarPropertyValue(config4, missingScalars, type);
70547
70565
  } else if (graphql18.isEnumType(type)) {
70566
+ ensureImports({
70567
+ config: config4,
70568
+ body,
70569
+ importKind: "type",
70570
+ import: ["ValueOf"],
70571
+ sourceModule: "$houdini/runtime/lib/types"
70572
+ });
70548
70573
  if (!visitedTypes.has(type.name)) {
70549
70574
  ensureImports({
70550
70575
  config: config4,
@@ -70554,7 +70579,7 @@ function inlineType({
70554
70579
  });
70555
70580
  visitedTypes.add(type.name);
70556
70581
  }
70557
- result = AST10.tsTypeReference(AST10.identifier(type.name));
70582
+ result = enumReference(config4, body, type.name);
70558
70583
  } else if (selections) {
70559
70584
  const rootObj = type;
70560
70585
  const inlineFragments = {};
@@ -70987,7 +71012,7 @@ async function generateOperationTypeDefs(config4, filepath, body, definition, se
70987
71012
  return AST11.tsPropertySignature(
70988
71013
  AST11.identifier(definition2.variable.name.value),
70989
71014
  AST11.tsTypeAnnotation(
70990
- tsTypeReference(config4, missingScalars, definition2)
71015
+ tsTypeReference(config4, missingScalars, definition2, body)
70991
71016
  ),
70992
71017
  definition2.type.kind !== "NonNullType"
70993
71018
  );
@@ -71054,7 +71079,12 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
71054
71079
  return AST11.tsPropertySignature(
71055
71080
  AST11.identifier(definition2.variable.name.value),
71056
71081
  AST11.tsTypeAnnotation(
71057
- tsTypeReference(config4, missingScalars, definition2)
71082
+ tsTypeReference(
71083
+ config4,
71084
+ missingScalars,
71085
+ definition2,
71086
+ body
71087
+ )
71058
71088
  ),
71059
71089
  definition2.type.kind !== "NonNullType"
71060
71090
  );
@@ -71147,7 +71177,7 @@ async function imperativeCacheTypef(config4, docs) {
71147
71177
  ),
71148
71178
  AST12.tsPropertySignature(
71149
71179
  AST12.identifier("lists"),
71150
- AST12.tsTypeAnnotation(listDefinitions(config4, docs))
71180
+ AST12.tsTypeAnnotation(listDefinitions(config4, body, docs))
71151
71181
  ),
71152
71182
  AST12.tsPropertySignature(
71153
71183
  AST12.identifier("queries"),
@@ -71256,7 +71286,7 @@ function typeDefinitions(config4, body, docs, returnType) {
71256
71286
  const prop = AST12.tsPropertySignature(
71257
71287
  AST12.identifier(arg.name),
71258
71288
  AST12.tsTypeAnnotation(
71259
- tsTypeReference(config4, /* @__PURE__ */ new Set(), arg)
71289
+ tsTypeReference(config4, /* @__PURE__ */ new Set(), arg, body)
71260
71290
  )
71261
71291
  );
71262
71292
  const unwrapped2 = unwrapType(config4, arg.type);
@@ -71306,7 +71336,7 @@ function typeDefinitions(config4, body, docs, returnType) {
71306
71336
  })
71307
71337
  );
71308
71338
  }
71309
- function listDefinitions(config4, docs) {
71339
+ function listDefinitions(config4, body, docs) {
71310
71340
  const lists = [];
71311
71341
  const visitedLists = /* @__PURE__ */ new Set();
71312
71342
  for (const doc of docs) {
@@ -71363,7 +71393,8 @@ function listDefinitions(config4, docs) {
71363
71393
  tsTypeReference(
71364
71394
  config4,
71365
71395
  /* @__PURE__ */ new Set(),
71366
- arg
71396
+ arg,
71397
+ body
71367
71398
  )
71368
71399
  )
71369
71400
  );
@@ -71557,9 +71588,9 @@ async function definitionsGenerator(config4) {
71557
71588
  ).code;
71558
71589
  const typeDefinitions2 = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
71559
71590
  (definition) => `
71560
- export declare enum ${definition.name.value} {
71561
- ${definition.values?.map((value) => ` ${value.name.value} = "${value.name.value}"`).join(",\n")}
71562
- }
71591
+ export const ${definition.name.value} = {
71592
+ ${definition.values?.map((value) => ` ${value.name.value}: "${value.name.value}"`).join(",\n")}
71593
+ } as const
71563
71594
  `
71564
71595
  ).join("");
71565
71596
  const definitionsIndex = `
@@ -73175,9 +73206,10 @@ function vite_default(opts) {
73175
73206
  name: "Houdini",
73176
73207
  quiet: true,
73177
73208
  async watchFile(filepath) {
73178
- const config4 = await getConfig(opts);
73209
+ let config4 = await getConfig(opts);
73179
73210
  const schemaPath = path_exports.join(path_exports.dirname(config4.filepath), config4.schemaPath);
73180
73211
  if ((0, import_minimatch2.default)(filepath, schemaPath)) {
73212
+ config4 = await getConfig({ ...opts, forceReload: true });
73181
73213
  return true;
73182
73214
  }
73183
73215
  return config4.includeFile(filepath, { root: process.cwd() });