houdini 1.2.43 → 1.2.45

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 (62) hide show
  1. package/build/cmd-cjs/index.js +684 -786
  2. package/build/cmd-esm/index.js +534 -636
  3. package/build/codegen/generators/artifacts/inputs.d.ts +1 -1
  4. package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
  5. package/build/codegen/transforms/index.d.ts +1 -0
  6. package/build/codegen/transforms/runtimeScalars.d.ts +2 -0
  7. package/build/codegen-cjs/index.js +677 -782
  8. package/build/codegen-esm/index.js +527 -632
  9. package/build/lib/config.d.ts +1 -0
  10. package/build/lib/graphql.d.ts +1 -1
  11. package/build/lib/index.d.ts +1 -0
  12. package/build/lib/typescript.d.ts +19 -0
  13. package/build/lib-cjs/index.js +711 -477
  14. package/build/lib-esm/index.js +705 -477
  15. package/build/runtime/client/index.d.ts +7 -1
  16. package/build/runtime/client/plugins/fragment.d.ts +2 -2
  17. package/build/runtime/client/plugins/mutation.d.ts +2 -1
  18. package/build/runtime/client/plugins/query.d.ts +2 -2
  19. package/build/runtime/lib/config.d.ts +12 -2
  20. package/build/runtime/lib/scalars.d.ts +1 -1
  21. package/build/runtime/lib/types.d.ts +17 -2
  22. package/build/runtime/router/session.d.ts +1 -2
  23. package/build/runtime/router/types.d.ts +3 -1
  24. package/build/runtime-cjs/client/index.d.ts +7 -1
  25. package/build/runtime-cjs/client/index.js +26 -11
  26. package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
  27. package/build/runtime-cjs/client/plugins/fragment.js +4 -11
  28. package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
  29. package/build/runtime-cjs/client/plugins/mutation.js +8 -15
  30. package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
  31. package/build/runtime-cjs/client/plugins/query.js +18 -11
  32. package/build/runtime-cjs/lib/config.d.ts +12 -2
  33. package/build/runtime-cjs/lib/scalars.d.ts +1 -1
  34. package/build/runtime-cjs/lib/scalars.js +4 -0
  35. package/build/runtime-cjs/lib/types.d.ts +17 -2
  36. package/build/runtime-cjs/router/server.js +2 -3
  37. package/build/runtime-cjs/router/session.d.ts +1 -2
  38. package/build/runtime-cjs/router/session.js +25 -11
  39. package/build/runtime-cjs/router/types.d.ts +3 -1
  40. package/build/runtime-esm/client/index.d.ts +7 -1
  41. package/build/runtime-esm/client/index.js +26 -11
  42. package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
  43. package/build/runtime-esm/client/plugins/fragment.js +1 -2
  44. package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
  45. package/build/runtime-esm/client/plugins/mutation.js +1 -2
  46. package/build/runtime-esm/client/plugins/query.d.ts +2 -2
  47. package/build/runtime-esm/client/plugins/query.js +15 -2
  48. package/build/runtime-esm/lib/config.d.ts +12 -2
  49. package/build/runtime-esm/lib/scalars.d.ts +1 -1
  50. package/build/runtime-esm/lib/scalars.js +6 -0
  51. package/build/runtime-esm/lib/types.d.ts +17 -2
  52. package/build/runtime-esm/router/server.js +2 -3
  53. package/build/runtime-esm/router/session.d.ts +1 -2
  54. package/build/runtime-esm/router/session.js +25 -11
  55. package/build/runtime-esm/router/types.d.ts +3 -1
  56. package/build/test-cjs/index.js +706 -785
  57. package/build/test-esm/index.js +556 -635
  58. package/build/vite-cjs/index.js +793 -793
  59. package/build/vite-esm/index.js +643 -643
  60. package/package.json +1 -1
  61. package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
  62. package/build/codegen/generators/typescript/types.d.ts +0 -10
@@ -30948,7 +30948,7 @@ var require_path_visitor = __commonJS({
30948
30948
  }
30949
30949
  return target;
30950
30950
  }
30951
- PathVisitor.visit = function visit19(node, methods) {
30951
+ PathVisitor.visit = function visit20(node, methods) {
30952
30952
  return PathVisitor.fromMethodsObject(methods).visit(node);
30953
30953
  };
30954
30954
  var PVp = PathVisitor.prototype;
@@ -31139,7 +31139,7 @@ var require_path_visitor = __commonJS({
31139
31139
  this.needToCallTraverse = false;
31140
31140
  return visitChildren(path3, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
31141
31141
  };
31142
- sharedContextProtoMethods.visit = function visit19(path3, newVisitor) {
31142
+ sharedContextProtoMethods.visit = function visit20(path3, newVisitor) {
31143
31143
  if (!(this instanceof this.Context)) {
31144
31144
  throw new Error("");
31145
31145
  }
@@ -32532,7 +32532,7 @@ var require_main = __commonJS({
32532
32532
  var someField = _a.someField;
32533
32533
  var Type = _a.Type;
32534
32534
  var use = _a.use;
32535
- var visit19 = _a.visit;
32535
+ var visit20 = _a.visit;
32536
32536
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
32537
32537
  exports.builders = builders;
32538
32538
  exports.builtInTypes = builtInTypes;
@@ -32549,7 +32549,7 @@ var require_main = __commonJS({
32549
32549
  exports.someField = someField;
32550
32550
  exports.Type = Type;
32551
32551
  exports.use = use;
32552
- exports.visit = visit19;
32552
+ exports.visit = visit20;
32553
32553
  Object.assign(namedTypes_1.namedTypes, n);
32554
32554
  }
32555
32555
  });
@@ -63305,47 +63305,6 @@ function deepMerge(...objects) {
63305
63305
  return mergedObj;
63306
63306
  }
63307
63307
 
63308
- // src/runtime/lib/scalars.ts
63309
- async function marshalSelection({
63310
- selection,
63311
- data
63312
- }) {
63313
- const config = getCurrentConfig();
63314
- if (data === null || typeof data === "undefined") {
63315
- return data;
63316
- }
63317
- if (Array.isArray(data)) {
63318
- return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
63319
- }
63320
- const targetSelection = getFieldsForType(selection, data["__typename"], false);
63321
- return Object.fromEntries(
63322
- await Promise.all(
63323
- Object.entries(data).map(async ([fieldName, value]) => {
63324
- const { type, selection: selection2 } = targetSelection[fieldName];
63325
- if (!type) {
63326
- return [fieldName, value];
63327
- }
63328
- if (selection2) {
63329
- return [fieldName, await marshalSelection({ selection: selection2, data: value })];
63330
- }
63331
- if (config.scalars?.[type]) {
63332
- const marshalFn = config.scalars[type].marshal;
63333
- if (!marshalFn) {
63334
- throw new Error(
63335
- `scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
63336
- );
63337
- }
63338
- if (Array.isArray(value)) {
63339
- return [fieldName, value.map(marshalFn)];
63340
- }
63341
- return [fieldName, marshalFn(value)];
63342
- }
63343
- return [fieldName, value];
63344
- })
63345
- )
63346
- );
63347
- }
63348
-
63349
63308
  // src/runtime/lib/types.ts
63350
63309
  var CachePolicy = {
63351
63310
  CacheOrNetwork: "CacheOrNetwork",
@@ -63373,11 +63332,6 @@ var RefetchUpdateMode = {
63373
63332
  prepend: "prepend",
63374
63333
  replace: "replace"
63375
63334
  };
63376
- var DataSource = {
63377
- Cache: "cache",
63378
- Network: "network",
63379
- Ssr: "ssr"
63380
- };
63381
63335
  var fragmentKey = " $fragments";
63382
63336
  var PendingValue = Symbol("houdini_loading");
63383
63337
 
@@ -67285,188 +67239,6 @@ var cache_default = new Cache();
67285
67239
  // src/runtime/client/plugins/cache.ts
67286
67240
  var serverSide = typeof globalThis.window === "undefined";
67287
67241
 
67288
- // src/runtime/client/utils/documentPlugins.ts
67289
- var documentPlugin = (kind, source) => {
67290
- return () => {
67291
- const sourceHandlers = source();
67292
- const enterWrapper = (handler) => {
67293
- return !handler ? void 0 : (ctx, handlers) => {
67294
- if (ctx.artifact.kind !== kind) {
67295
- return handlers.next(ctx);
67296
- }
67297
- return handler(ctx, handlers);
67298
- };
67299
- };
67300
- const exitWrapper = (handler) => {
67301
- return !handler ? void 0 : (ctx, handlers) => {
67302
- if (ctx.artifact.kind !== kind) {
67303
- return handlers.resolve(ctx);
67304
- }
67305
- return handler(ctx, handlers);
67306
- };
67307
- };
67308
- return {
67309
- start: enterWrapper(sourceHandlers.start),
67310
- network: enterWrapper(sourceHandlers.network),
67311
- afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
67312
- end: exitWrapper(sourceHandlers.end),
67313
- catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
67314
- cleanup: (...args) => sourceHandlers.cleanup?.(...args)
67315
- };
67316
- };
67317
- };
67318
-
67319
- // src/runtime/client/plugins/query.ts
67320
- var query = documentPlugin(ArtifactKind.Query, function() {
67321
- let subscriptionSpec = null;
67322
- let lastVariables = null;
67323
- return {
67324
- start(ctx, { next }) {
67325
- ctx.variables = {
67326
- ...lastVariables,
67327
- ...ctx.variables
67328
- };
67329
- next(ctx);
67330
- },
67331
- end(ctx, { resolve: resolve2, marshalVariables, variablesChanged }) {
67332
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
67333
- if (subscriptionSpec) {
67334
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
67335
- }
67336
- lastVariables = { ...marshalVariables(ctx) };
67337
- const variables = lastVariables;
67338
- subscriptionSpec = {
67339
- rootType: ctx.artifact.rootType,
67340
- selection: ctx.artifact.selection,
67341
- variables: () => variables,
67342
- set: (newValue) => {
67343
- resolve2(ctx, {
67344
- data: newValue,
67345
- errors: null,
67346
- fetching: false,
67347
- partial: false,
67348
- stale: false,
67349
- source: DataSource.Cache,
67350
- variables: ctx.variables ?? {}
67351
- });
67352
- }
67353
- };
67354
- cache_default.subscribe(subscriptionSpec, lastVariables);
67355
- }
67356
- resolve2(ctx);
67357
- },
67358
- cleanup() {
67359
- if (subscriptionSpec) {
67360
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
67361
- lastVariables = null;
67362
- }
67363
- }
67364
- };
67365
- });
67366
-
67367
- // src/runtime/client/plugins/fragment.ts
67368
- var fragment = documentPlugin(ArtifactKind.Fragment, function() {
67369
- let subscriptionSpec = null;
67370
- let lastReference = null;
67371
- return {
67372
- start(ctx, { next, resolve: resolve2, variablesChanged, marshalVariables }) {
67373
- if (!ctx.stuff.parentID) {
67374
- return next(ctx);
67375
- }
67376
- const currentReference = {
67377
- parent: ctx.stuff.parentID,
67378
- variables: marshalVariables(ctx)
67379
- };
67380
- if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged(ctx))) {
67381
- if (subscriptionSpec) {
67382
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
67383
- }
67384
- const variables = marshalVariables(ctx);
67385
- subscriptionSpec = {
67386
- rootType: ctx.artifact.rootType,
67387
- selection: ctx.artifact.selection,
67388
- variables: () => variables,
67389
- parentID: ctx.stuff.parentID,
67390
- set: (newValue) => {
67391
- resolve2(ctx, {
67392
- data: newValue,
67393
- errors: null,
67394
- fetching: false,
67395
- partial: false,
67396
- stale: false,
67397
- source: DataSource.Cache,
67398
- variables
67399
- });
67400
- }
67401
- };
67402
- cache_default.subscribe(subscriptionSpec, variables);
67403
- lastReference = currentReference;
67404
- }
67405
- next(ctx);
67406
- },
67407
- cleanup() {
67408
- if (subscriptionSpec) {
67409
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
67410
- }
67411
- }
67412
- };
67413
- });
67414
-
67415
- // src/runtime/client/plugins/mutation.ts
67416
- var mutation = documentPlugin(ArtifactKind.Mutation, () => {
67417
- return {
67418
- async start(ctx, { next, marshalVariables }) {
67419
- const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
67420
- const optimisticResponse = ctx.stuff.optimisticResponse;
67421
- let toNotify = [];
67422
- if (optimisticResponse) {
67423
- toNotify = cache_default.write({
67424
- selection: ctx.artifact.selection,
67425
- data: await marshalSelection({
67426
- selection: ctx.artifact.selection,
67427
- data: optimisticResponse
67428
- }),
67429
- variables: marshalVariables(ctx),
67430
- layer: layerOptimistic.id
67431
- });
67432
- }
67433
- ctx.cacheParams = {
67434
- ...ctx.cacheParams,
67435
- layer: layerOptimistic,
67436
- notifySubscribers: toNotify,
67437
- forceNotify: true
67438
- };
67439
- next(ctx);
67440
- },
67441
- afterNetwork(ctx, { resolve: resolve2 }) {
67442
- if (ctx.cacheParams?.layer) {
67443
- cache_default.clearLayer(ctx.cacheParams.layer.id);
67444
- }
67445
- resolve2(ctx);
67446
- },
67447
- end(ctx, { resolve: resolve2, value }) {
67448
- const hasErrors = value.errors && value.errors.length > 0;
67449
- if (hasErrors) {
67450
- if (ctx.cacheParams?.layer) {
67451
- cache_default.clearLayer(ctx.cacheParams.layer.id);
67452
- }
67453
- }
67454
- if (ctx.cacheParams?.layer) {
67455
- cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
67456
- }
67457
- resolve2(ctx);
67458
- },
67459
- catch(ctx, { error }) {
67460
- if (ctx.cacheParams?.layer) {
67461
- const { layer } = ctx.cacheParams;
67462
- cache_default.clearLayer(layer.id);
67463
- cache_default._internal_unstable.storage.resolveLayer(layer.id);
67464
- }
67465
- throw error;
67466
- }
67467
- };
67468
- });
67469
-
67470
67242
  // src/lib/types.ts
67471
67243
  var LogLevel = {
67472
67244
  Full: "full",
@@ -67904,6 +67676,9 @@ var Config = class {
67904
67676
  get loadingDirective() {
67905
67677
  return `loading`;
67906
67678
  }
67679
+ get runtimeScalarDirective() {
67680
+ return "__houdini__runtimeScalar";
67681
+ }
67907
67682
  get whenDirective() {
67908
67683
  return "when";
67909
67684
  }
@@ -67974,7 +67749,7 @@ var Config = class {
67974
67749
  const internalDirectives = this.#newSchemaInstance?.getDirectives().reduce((list, directive) => {
67975
67750
  return list.concat(directive.name);
67976
67751
  }, []) ?? [];
67977
- return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
67752
+ return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name) || name === this.runtimeScalarDirective);
67978
67753
  }
67979
67754
  get componentFieldDirective() {
67980
67755
  return "componentField";
@@ -68477,7 +68252,7 @@ function formatErrors(e3, afterError) {
68477
68252
  afterError?.(e3);
68478
68253
  }
68479
68254
  }
68480
- function unwrapType(config, type, wrappers = []) {
68255
+ function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
68481
68256
  if (type.kind === "NonNullType") {
68482
68257
  return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
68483
68258
  }
@@ -68493,9 +68268,14 @@ function unwrapType(config, type, wrappers = []) {
68493
68268
  if (type instanceof graphql3.GraphQLList) {
68494
68269
  return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
68495
68270
  }
68271
+ if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
68272
+ type = config.schema.getType(
68273
+ config.configFile.features?.runtimeScalars?.[type.name.value].type
68274
+ );
68275
+ }
68496
68276
  const namedType = config.schema.getType(type.name.value || type.name);
68497
68277
  if (!namedType) {
68498
- throw new Error("Could not unwrap type: " + JSON.stringify(type));
68278
+ throw new Error("Unknown type: " + type.name.value || type.name);
68499
68279
  }
68500
68280
  return { type: namedType, wrappers };
68501
68281
  }
@@ -68687,6 +68467,152 @@ async function detectTools(cwd = process.cwd()) {
68687
68467
  };
68688
68468
  }
68689
68469
 
68470
+ // src/lib/typescript.ts
68471
+ var graphql4 = __toESM(require("graphql"), 1);
68472
+ var recast2 = __toESM(require_main2(), 1);
68473
+ var AST2 = recast2.types.builders;
68474
+ function unwrappedTsTypeReference(config, filepath, missingScalars, {
68475
+ type,
68476
+ wrappers
68477
+ }, body) {
68478
+ let result;
68479
+ if (graphql4.isScalarType(type)) {
68480
+ result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
68481
+ } else if (graphql4.isEnumType(type)) {
68482
+ result = enumReference(config, body, type.name);
68483
+ } else {
68484
+ result = AST2.tsTypeReference(AST2.identifier(type.name));
68485
+ }
68486
+ for (const toWrap of wrappers) {
68487
+ if (toWrap === "NonNull" /* NonNull */) {
68488
+ continue;
68489
+ } else if (toWrap === "Nullable" /* Nullable */) {
68490
+ result = nullableField(result, true);
68491
+ } else if (toWrap === "List" /* List */) {
68492
+ result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
68493
+ }
68494
+ }
68495
+ return result;
68496
+ }
68497
+ function tsTypeReference(config, filepath, missingScalars, definition, body) {
68498
+ const { type, wrappers } = unwrapType(config, definition.type);
68499
+ return unwrappedTsTypeReference(
68500
+ config,
68501
+ filepath,
68502
+ missingScalars,
68503
+ { type, wrappers },
68504
+ body
68505
+ );
68506
+ }
68507
+ function enumReference(config, body, name) {
68508
+ ensureImports({
68509
+ config,
68510
+ body,
68511
+ import: ["ValueOf"],
68512
+ importKind: "type",
68513
+ sourceModule: "$houdini/runtime/lib/types"
68514
+ });
68515
+ return AST2.tsTypeReference(
68516
+ AST2.identifier("ValueOf"),
68517
+ AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
68518
+ );
68519
+ }
68520
+ function readonlyProperty(prop, enable = true) {
68521
+ if (enable) {
68522
+ prop.readonly = true;
68523
+ }
68524
+ return prop;
68525
+ }
68526
+ function nullableField(inner, input = false) {
68527
+ const members = [inner, AST2.tsNullKeyword()];
68528
+ if (input) {
68529
+ members.push(AST2.tsUndefinedKeyword());
68530
+ }
68531
+ return AST2.tsUnionType(members);
68532
+ }
68533
+ function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
68534
+ if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
68535
+ if (!field) {
68536
+ return AST2.tsNeverKeyword();
68537
+ }
68538
+ const component = config.componentFields[field.parent][field.field];
68539
+ const sourcePathRelative = path_exports.relative(
68540
+ path_exports.join(config.projectRoot, "src"),
68541
+ component.filepath
68542
+ );
68543
+ let sourcePathParsed = path_exports.parse(sourcePathRelative);
68544
+ let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
68545
+ const localImport = ensureImports({
68546
+ config,
68547
+ body,
68548
+ import: "__component__" + component.fragment,
68549
+ sourceModule: path_exports.join(
68550
+ path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
68551
+ "src",
68552
+ sourcePath
68553
+ )
68554
+ }) ?? "__component__" + component.fragment;
68555
+ const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
68556
+ parameters.typeParameters = AST2.tsTypeParameterInstantiation([
68557
+ AST2.tsTypeQuery(AST2.identifier(localImport))
68558
+ ]);
68559
+ const indexed = AST2.tsIndexedAccessType(
68560
+ parameters,
68561
+ AST2.tsLiteralType(AST2.numericLiteral(0))
68562
+ );
68563
+ const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
68564
+ omit.typeParameters = AST2.tsTypeParameterInstantiation([
68565
+ indexed,
68566
+ AST2.tsLiteralType(AST2.stringLiteral(component.prop))
68567
+ ]);
68568
+ const arg = AST2.identifier("props");
68569
+ arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
68570
+ const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
68571
+ returnType.typeParameters = AST2.tsTypeParameterInstantiation([
68572
+ AST2.tsTypeQuery(AST2.identifier(localImport))
68573
+ ]);
68574
+ const fnType = AST2.tsFunctionType([arg]);
68575
+ fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
68576
+ return fnType;
68577
+ }
68578
+ switch (target.name) {
68579
+ case "String": {
68580
+ return AST2.tsStringKeyword();
68581
+ }
68582
+ case "Int": {
68583
+ return AST2.tsNumberKeyword();
68584
+ }
68585
+ case "Float": {
68586
+ return AST2.tsNumberKeyword();
68587
+ }
68588
+ case "Boolean": {
68589
+ return AST2.tsBooleanKeyword();
68590
+ }
68591
+ case "ID": {
68592
+ return AST2.tsStringKeyword();
68593
+ }
68594
+ default: {
68595
+ if (graphql4.isNonNullType(target) && "ofType" in target) {
68596
+ return scalarPropertyValue(
68597
+ config,
68598
+ filepath,
68599
+ missingScalars,
68600
+ target.ofType,
68601
+ body,
68602
+ field
68603
+ );
68604
+ }
68605
+ if (config.scalars?.[target.name]) {
68606
+ return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
68607
+ }
68608
+ if (target.name !== config.componentScalar) {
68609
+ missingScalars.add(target.name);
68610
+ }
68611
+ return AST2.tsAnyKeyword();
68612
+ }
68613
+ }
68614
+ }
68615
+
68690
68616
  // ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
68691
68617
  var WalkerBase = class {
68692
68618
  constructor() {
@@ -68800,7 +68726,7 @@ async function asyncWalk(ast, { enter, leave }) {
68800
68726
  }
68801
68727
 
68802
68728
  // src/lib/walk.ts
68803
- var graphql4 = __toESM(require("graphql"), 1);
68729
+ var graphql5 = __toESM(require("graphql"), 1);
68804
68730
  async function find_graphql(config, parsedScript, walker) {
68805
68731
  await asyncWalk(parsedScript, {
68806
68732
  async enter(node, parent2) {
@@ -68855,7 +68781,7 @@ async function find_graphql(config, parsedScript, walker) {
68855
68781
  } else if (!documentString) {
68856
68782
  return;
68857
68783
  }
68858
- const parsedTag = graphql4.parse(documentString);
68784
+ const parsedTag = graphql5.parse(documentString);
68859
68785
  if (walker.where && !walker.where(parsedTag, { node, parent: parent2 })) {
68860
68786
  return;
68861
68787
  }
@@ -68987,7 +68913,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
68987
68913
  };
68988
68914
  return defs.concat([
68989
68915
  {
68990
- raw: graphql4.print(parsed),
68916
+ raw: graphql5.print(parsed),
68991
68917
  parsed
68992
68918
  }
68993
68919
  ]);
@@ -69002,7 +68928,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
69002
68928
 
69003
68929
  // src/lib/router/manifest.ts
69004
68930
  var t2 = __toESM(require_lib6(), 1);
69005
- var graphql5 = __toESM(require("graphql"), 1);
68931
+ var graphql6 = __toESM(require("graphql"), 1);
69006
68932
 
69007
68933
  // src/lib/router/server.ts
69008
68934
  var import_node_path2 = __toESM(require("node:path"), 1);
@@ -69043,8 +68969,8 @@ async function loadLocalSchema(config) {
69043
68969
  var graphql32 = __toESM(require("graphql"), 1);
69044
68970
 
69045
68971
  // src/codegen/generators/artifacts/index.ts
69046
- var graphql16 = __toESM(require("graphql"), 1);
69047
- var recast4 = __toESM(require_main2(), 1);
68972
+ var graphql17 = __toESM(require("graphql"), 1);
68973
+ var recast5 = __toESM(require_main2(), 1);
69048
68974
 
69049
68975
  // src/codegen/utils/commonjs.ts
69050
68976
  var cjsIndexFilePreamble = `"use strict";
@@ -69286,19 +69212,19 @@ var FieldCollection = class {
69286
69212
  };
69287
69213
 
69288
69214
  // src/codegen/utils/moduleExport.ts
69289
- var recast2 = __toESM(require_main2(), 1);
69290
- var AST2 = recast2.types.builders;
69215
+ var recast3 = __toESM(require_main2(), 1);
69216
+ var AST3 = recast3.types.builders;
69291
69217
  function moduleExport(config, key, value) {
69292
69218
  if (config.module === "commonjs") {
69293
- let target = AST2.memberExpression(AST2.identifier("module"), AST2.identifier("exports"));
69219
+ let target = AST3.memberExpression(AST3.identifier("module"), AST3.identifier("exports"));
69294
69220
  if (key !== "default") {
69295
- target = AST2.memberExpression(target, AST2.identifier(key));
69221
+ target = AST3.memberExpression(target, AST3.identifier(key));
69296
69222
  }
69297
- return AST2.expressionStatement(AST2.assignmentExpression("=", target, value));
69223
+ return AST3.expressionStatement(AST3.assignmentExpression("=", target, value));
69298
69224
  }
69299
- return key === "default" ? AST2.exportDefaultDeclaration(value) : AST2.exportNamedDeclaration(
69300
- AST2.variableDeclaration("const", [
69301
- AST2.variableDeclarator(AST2.identifier(key), value)
69225
+ return key === "default" ? AST3.exportDefaultDeclaration(value) : AST3.exportNamedDeclaration(
69226
+ AST3.variableDeclaration("const", [
69227
+ AST3.variableDeclarator(AST3.identifier(key), value)
69302
69228
  ])
69303
69229
  );
69304
69230
  }
@@ -69555,7 +69481,7 @@ var serialize = (value, { json, lossy } = {}) => {
69555
69481
  var esm_default = typeof structuredClone === "function" ? (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any) : (any, options) => deserialize(serialize(any, options));
69556
69482
 
69557
69483
  // src/codegen/transforms/fragmentVariables.ts
69558
- var graphql7 = __toESM(require("graphql"), 1);
69484
+ var graphql8 = __toESM(require("graphql"), 1);
69559
69485
 
69560
69486
  // src/codegen/utils/stripLoc.ts
69561
69487
  function stripLoc(value) {
@@ -69576,13 +69502,13 @@ function stripLoc(value) {
69576
69502
  }
69577
69503
 
69578
69504
  // src/codegen/transforms/collectDefinitions.ts
69579
- var graphql6 = __toESM(require("graphql"), 1);
69580
- var import_graphql31 = require("graphql");
69505
+ var graphql7 = __toESM(require("graphql"), 1);
69506
+ var import_graphql32 = require("graphql");
69581
69507
  async function includeFragmentDefinitions(config, documents) {
69582
69508
  const fragments = collectDefinitions(config, documents);
69583
69509
  for (const [index, { name, document, filename }] of documents.entries()) {
69584
69510
  const operation = document.definitions.find(
69585
- (def) => def.kind === import_graphql31.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
69511
+ (def) => def.kind === import_graphql32.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
69586
69512
  );
69587
69513
  if (!operation) {
69588
69514
  continue;
@@ -69626,10 +69552,10 @@ function collectDefinitions(config, docs) {
69626
69552
  }
69627
69553
  function findRequiredFragments(config, definition) {
69628
69554
  const referencedFragments = [];
69629
- const typeInfo = new graphql6.TypeInfo(config.schema);
69630
- definition.selectionSet = graphql6.visit(
69555
+ const typeInfo = new graphql7.TypeInfo(config.schema);
69556
+ definition.selectionSet = graphql7.visit(
69631
69557
  definition,
69632
- graphql6.visitWithTypeInfo(typeInfo, {
69558
+ graphql7.visitWithTypeInfo(typeInfo, {
69633
69559
  FragmentSpread(node) {
69634
69560
  referencedFragments.push(node.name.value);
69635
69561
  }
@@ -69663,7 +69589,7 @@ function flattenFragments(filepath, operation, fragments) {
69663
69589
  }
69664
69590
 
69665
69591
  // src/codegen/transforms/fragmentVariables.ts
69666
- var GraphqlKinds2 = graphql7.Kind;
69592
+ var GraphqlKinds2 = graphql8.Kind;
69667
69593
  async function fragmentVariables(config, documents) {
69668
69594
  const fragments = collectDefinitions(config, documents);
69669
69595
  const generatedFragments = {};
@@ -69686,7 +69612,7 @@ async function fragmentVariables(config, documents) {
69686
69612
  });
69687
69613
  }
69688
69614
  const doc = {
69689
- kind: graphql7.Kind.DOCUMENT,
69615
+ kind: graphql8.Kind.DOCUMENT,
69690
69616
  definitions: Object.values(generatedFragments)
69691
69617
  };
69692
69618
  documents.push({
@@ -69757,7 +69683,7 @@ function inlineFragmentArgs({
69757
69683
  return null;
69758
69684
  };
69759
69685
  const result = esm_default(
69760
- graphql7.visit(document, {
69686
+ graphql8.visit(document, {
69761
69687
  FragmentSpread(node) {
69762
69688
  if (!fragmentDefinitions[node.name.value]) {
69763
69689
  throw new Error("Could not find definition for fragment" + node.name.value);
@@ -69843,7 +69769,7 @@ function inlineFragmentArgs({
69843
69769
  );
69844
69770
  if (newName) {
69845
69771
  result.name = {
69846
- kind: graphql7.Kind.NAME,
69772
+ kind: graphql8.Kind.NAME,
69847
69773
  value: newName
69848
69774
  };
69849
69775
  }
@@ -70010,8 +69936,8 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
70010
69936
  }
70011
69937
 
70012
69938
  // src/codegen/generators/artifacts/inputs.ts
70013
- var graphql8 = __toESM(require("graphql"), 1);
70014
- function inputObject(config, inputs) {
69939
+ var graphql9 = __toESM(require("graphql"), 1);
69940
+ function inputObject(config, inputs, runtimeScalars) {
70015
69941
  const visitedTypes = /* @__PURE__ */ new Set();
70016
69942
  const inputObj = {
70017
69943
  fields: inputs.reduce((fields, input) => {
@@ -70027,7 +69953,8 @@ function inputObject(config, inputs) {
70027
69953
  ...fields,
70028
69954
  [input.variable.name.value]: input.defaultValue ? variableValue(input.defaultValue, {}) : void 0
70029
69955
  };
70030
- }, {})
69956
+ }, {}),
69957
+ runtimeScalars
70031
69958
  };
70032
69959
  for (const input of inputs) {
70033
69960
  walkInputs(config, visitedTypes, inputObj, input.type);
@@ -70039,10 +69966,10 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
70039
69966
  if (visitedTypes.has(type.name)) {
70040
69967
  return;
70041
69968
  }
70042
- if (graphql8.isEnumType(type) || graphql8.isScalarType(type)) {
69969
+ if (graphql9.isEnumType(type) || graphql9.isScalarType(type)) {
70043
69970
  return;
70044
69971
  }
70045
- if (graphql8.isUnionType(type)) {
69972
+ if (graphql9.isUnionType(type)) {
70046
69973
  return;
70047
69974
  }
70048
69975
  visitedTypes.add(type.name);
@@ -70060,50 +69987,50 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
70060
69987
  }
70061
69988
 
70062
69989
  // src/codegen/generators/artifacts/operations.ts
70063
- var graphql10 = __toESM(require("graphql"), 1);
69990
+ var graphql11 = __toESM(require("graphql"), 1);
70064
69991
 
70065
69992
  // src/codegen/generators/artifacts/utils.ts
70066
- var graphql9 = __toESM(require("graphql"), 1);
70067
- var recast3 = __toESM(require_main2(), 1);
70068
- var AST3 = recast3.types.builders;
69993
+ var graphql10 = __toESM(require("graphql"), 1);
69994
+ var recast4 = __toESM(require_main2(), 1);
69995
+ var AST4 = recast4.types.builders;
70069
69996
  function serializeValue(value) {
70070
69997
  if (Array.isArray(value)) {
70071
- return AST3.arrayExpression(value.map(serializeValue));
69998
+ return AST4.arrayExpression(value.map(serializeValue));
70072
69999
  }
70073
70000
  if (typeof value === "object" && value !== null) {
70074
- return AST3.objectExpression(
70001
+ return AST4.objectExpression(
70075
70002
  Object.entries(value).filter(([key, value2]) => typeof value2 !== "undefined").map(([key, val]) => {
70076
- return AST3.objectProperty(AST3.stringLiteral(key), serializeValue(val));
70003
+ return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
70077
70004
  })
70078
70005
  );
70079
70006
  }
70080
70007
  if (typeof value === "string") {
70081
70008
  if (value.indexOf("\n") !== -1) {
70082
- return AST3.templateLiteral(
70083
- [AST3.templateElement({ raw: value, cooked: value }, true)],
70009
+ return AST4.templateLiteral(
70010
+ [AST4.templateElement({ raw: value, cooked: value }, true)],
70084
70011
  []
70085
70012
  );
70086
70013
  }
70087
- return AST3.stringLiteral(value);
70014
+ return AST4.stringLiteral(value);
70088
70015
  }
70089
- return AST3.literal(value);
70016
+ return AST4.literal(value);
70090
70017
  }
70091
70018
  function convertValue(config, val) {
70092
70019
  let value;
70093
70020
  let kind;
70094
- if (val.kind === graphql9.Kind.INT) {
70021
+ if (val.kind === graphql10.Kind.INT) {
70095
70022
  value = parseInt(val.value, 10);
70096
70023
  kind = "Int";
70097
- } else if (val.kind === graphql9.Kind.FLOAT) {
70024
+ } else if (val.kind === graphql10.Kind.FLOAT) {
70098
70025
  value = parseFloat(val.value);
70099
70026
  kind = "Float";
70100
- } else if (val.kind === graphql9.Kind.BOOLEAN) {
70027
+ } else if (val.kind === graphql10.Kind.BOOLEAN) {
70101
70028
  value = val.value;
70102
70029
  kind = "Boolean";
70103
- } else if (val.kind === graphql9.Kind.VARIABLE) {
70030
+ } else if (val.kind === graphql10.Kind.VARIABLE) {
70104
70031
  value = val.name.value;
70105
70032
  kind = "Variable";
70106
- } else if (val.kind === graphql9.Kind.STRING) {
70033
+ } else if (val.kind === graphql10.Kind.STRING) {
70107
70034
  value = val.value;
70108
70035
  kind = "String";
70109
70036
  }
@@ -70116,7 +70043,7 @@ function operationsByPath(config, filepath, definition, filterTypes) {
70116
70043
  return {};
70117
70044
  }
70118
70045
  const pathOperations = {};
70119
- graphql10.visit(definition, {
70046
+ graphql11.visit(definition, {
70120
70047
  FragmentSpread(node, _3, __, ___, ancestors) {
70121
70048
  if (!config.isListFragment(node.name.value)) {
70122
70049
  return;
@@ -70275,19 +70202,19 @@ function ancestorKey(ancestors) {
70275
70202
  }
70276
70203
 
70277
70204
  // src/codegen/generators/artifacts/selection.ts
70278
- var graphql15 = __toESM(require("graphql"), 1);
70205
+ var graphql16 = __toESM(require("graphql"), 1);
70279
70206
 
70280
70207
  // src/codegen/transforms/list.ts
70281
- var graphql13 = __toESM(require("graphql"), 1);
70208
+ var graphql14 = __toESM(require("graphql"), 1);
70282
70209
 
70283
70210
  // src/codegen/utils/objectIdentificationSelection.ts
70284
- var graphql11 = __toESM(require("graphql"), 1);
70211
+ var graphql12 = __toESM(require("graphql"), 1);
70285
70212
  var objectIdentificationSelection = (config, type) => {
70286
70213
  return config.keyFieldsForType(type.name).map((key) => {
70287
70214
  return {
70288
- kind: graphql11.Kind.FIELD,
70215
+ kind: graphql12.Kind.FIELD,
70289
70216
  name: {
70290
- kind: graphql11.Kind.NAME,
70217
+ kind: graphql12.Kind.NAME,
70291
70218
  value: key
70292
70219
  }
70293
70220
  };
@@ -70295,7 +70222,7 @@ var objectIdentificationSelection = (config, type) => {
70295
70222
  };
70296
70223
 
70297
70224
  // src/codegen/transforms/paginate.ts
70298
- var graphql12 = __toESM(require("graphql"), 1);
70225
+ var graphql13 = __toESM(require("graphql"), 1);
70299
70226
  async function paginate(config, documents) {
70300
70227
  const newDocs = [];
70301
70228
  for (const doc of documents) {
@@ -70328,7 +70255,7 @@ async function paginate(config, documents) {
70328
70255
  };
70329
70256
  let cursorType = "String";
70330
70257
  let paginationPath = [];
70331
- doc.document = graphql12.visit(doc.document, {
70258
+ doc.document = graphql13.visit(doc.document, {
70332
70259
  Field(node, _3, __, ___, ancestors) {
70333
70260
  const paginateDirective = node.directives?.find(
70334
70261
  (directive) => directive.name.value === config.paginateDirective
@@ -70354,7 +70281,7 @@ async function paginate(config, documents) {
70354
70281
  flags.offset.enabled = offsetPagination;
70355
70282
  flags.limit.enabled = offsetPagination;
70356
70283
  paginationPath = ancestors.filter(
70357
- (ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql12.Kind.FIELD
70284
+ (ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql13.Kind.FIELD
70358
70285
  ).concat(node).map((field) => field.alias?.value || field.name.value);
70359
70286
  return {
70360
70287
  ...node,
@@ -70373,7 +70300,7 @@ async function paginate(config, documents) {
70373
70300
  let fragment2 = "";
70374
70301
  let paginateMode = config.defaultPaginateMode;
70375
70302
  const requiredArgs = [];
70376
- doc.document = graphql12.visit(doc.document, {
70303
+ doc.document = graphql13.visit(doc.document, {
70377
70304
  OperationDefinition(node) {
70378
70305
  if (node.operation !== "query") {
70379
70306
  throw new HoudiniError({
@@ -70432,9 +70359,9 @@ async function paginate(config, documents) {
70432
70359
  directives: [
70433
70360
  ...node.directives || [],
70434
70361
  {
70435
- kind: graphql12.Kind.DIRECTIVE,
70362
+ kind: graphql13.Kind.DIRECTIVE,
70436
70363
  name: {
70437
- kind: graphql12.Kind.NAME,
70364
+ kind: graphql13.Kind.NAME,
70438
70365
  value: config.argumentsDirective
70439
70366
  }
70440
70367
  }
@@ -70504,22 +70431,22 @@ async function paginate(config, documents) {
70504
70431
  const paginationArgs = Object.entries(flags).filter(([_3, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
70505
70432
  const fragmentSpreadSelection = [
70506
70433
  {
70507
- kind: graphql12.Kind.FRAGMENT_SPREAD,
70434
+ kind: graphql13.Kind.FRAGMENT_SPREAD,
70508
70435
  name: {
70509
- kind: graphql12.Kind.NAME,
70436
+ kind: graphql13.Kind.NAME,
70510
70437
  value: fragmentName
70511
70438
  },
70512
70439
  directives: [
70513
70440
  {
70514
- kind: graphql12.Kind.DIRECTIVE,
70441
+ kind: graphql13.Kind.DIRECTIVE,
70515
70442
  name: {
70516
- kind: graphql12.Kind.NAME,
70443
+ kind: graphql13.Kind.NAME,
70517
70444
  value: config.withDirective
70518
70445
  },
70519
70446
  ["arguments"]: requiredArgs.map((arg) => variableAsArgument(arg.name)).concat(paginationArgs.map(({ name }) => variableAsArgument(name)))
70520
70447
  },
70521
70448
  {
70522
- kind: graphql12.Kind.DIRECTIVE,
70449
+ kind: graphql13.Kind.DIRECTIVE,
70523
70450
  name: {
70524
70451
  kind: "Name",
70525
70452
  value: config.maskDisableDirective
@@ -70546,23 +70473,23 @@ async function paginate(config, documents) {
70546
70473
  });
70547
70474
  const typeConfig = config.typeConfig?.[fragment2];
70548
70475
  const queryDoc = {
70549
- kind: graphql12.Kind.DOCUMENT,
70476
+ kind: graphql13.Kind.DOCUMENT,
70550
70477
  definitions: [
70551
70478
  {
70552
- kind: graphql12.Kind.OPERATION_DEFINITION,
70479
+ kind: graphql13.Kind.OPERATION_DEFINITION,
70553
70480
  name: {
70554
- kind: graphql12.Kind.NAME,
70481
+ kind: graphql13.Kind.NAME,
70555
70482
  value: refetchQueryName
70556
70483
  },
70557
70484
  operation: "query",
70558
70485
  variableDefinitions: requiredArgs.map(
70559
70486
  (arg) => ({
70560
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70487
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70561
70488
  type: arg.type,
70562
70489
  variable: {
70563
- kind: graphql12.Kind.VARIABLE,
70490
+ kind: graphql13.Kind.VARIABLE,
70564
70491
  name: {
70565
- kind: graphql12.Kind.NAME,
70492
+ kind: graphql13.Kind.NAME,
70566
70493
  value: arg.name
70567
70494
  }
70568
70495
  }
@@ -70570,18 +70497,18 @@ async function paginate(config, documents) {
70570
70497
  ).concat(
70571
70498
  paginationArgs.map(
70572
70499
  (arg) => ({
70573
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70500
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70574
70501
  type: {
70575
- kind: graphql12.Kind.NAMED_TYPE,
70502
+ kind: graphql13.Kind.NAMED_TYPE,
70576
70503
  name: {
70577
- kind: graphql12.Kind.NAME,
70504
+ kind: graphql13.Kind.NAME,
70578
70505
  value: arg.type
70579
70506
  }
70580
70507
  },
70581
70508
  variable: {
70582
- kind: graphql12.Kind.VARIABLE,
70509
+ kind: graphql13.Kind.VARIABLE,
70583
70510
  name: {
70584
- kind: graphql12.Kind.NAME,
70511
+ kind: graphql13.Kind.NAME,
70585
70512
  value: arg.name
70586
70513
  }
70587
70514
  },
@@ -70593,12 +70520,12 @@ async function paginate(config, documents) {
70593
70520
  ).concat(
70594
70521
  !nodeQuery ? [] : keys2.map(
70595
70522
  (key) => ({
70596
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70523
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70597
70524
  type: key.type,
70598
70525
  variable: {
70599
- kind: graphql12.Kind.VARIABLE,
70526
+ kind: graphql13.Kind.VARIABLE,
70600
70527
  name: {
70601
- kind: graphql12.Kind.NAME,
70528
+ kind: graphql13.Kind.NAME,
70602
70529
  value: key.name
70603
70530
  }
70604
70531
  }
@@ -70607,42 +70534,42 @@ async function paginate(config, documents) {
70607
70534
  )
70608
70535
  ),
70609
70536
  selectionSet: {
70610
- kind: graphql12.Kind.SELECTION_SET,
70537
+ kind: graphql13.Kind.SELECTION_SET,
70611
70538
  selections: !nodeQuery ? fragmentSpreadSelection : [
70612
70539
  {
70613
- kind: graphql12.Kind.FIELD,
70540
+ kind: graphql13.Kind.FIELD,
70614
70541
  name: {
70615
- kind: graphql12.Kind.NAME,
70542
+ kind: graphql13.Kind.NAME,
70616
70543
  value: typeConfig?.resolve?.queryField || "node"
70617
70544
  },
70618
70545
  ["arguments"]: keys2.map((key) => ({
70619
- kind: graphql12.Kind.ARGUMENT,
70546
+ kind: graphql13.Kind.ARGUMENT,
70620
70547
  name: {
70621
- kind: graphql12.Kind.NAME,
70548
+ kind: graphql13.Kind.NAME,
70622
70549
  value: key.name
70623
70550
  },
70624
70551
  value: {
70625
- kind: graphql12.Kind.VARIABLE,
70552
+ kind: graphql13.Kind.VARIABLE,
70626
70553
  name: {
70627
- kind: graphql12.Kind.NAME,
70554
+ kind: graphql13.Kind.NAME,
70628
70555
  value: key.name
70629
70556
  }
70630
70557
  }
70631
70558
  })),
70632
70559
  selectionSet: {
70633
- kind: graphql12.Kind.SELECTION_SET,
70560
+ kind: graphql13.Kind.SELECTION_SET,
70634
70561
  selections: [
70635
70562
  {
70636
- kind: graphql12.Kind.FIELD,
70563
+ kind: graphql13.Kind.FIELD,
70637
70564
  name: {
70638
- kind: graphql12.Kind.NAME,
70565
+ kind: graphql13.Kind.NAME,
70639
70566
  value: "__typename"
70640
70567
  }
70641
70568
  },
70642
70569
  ...(typeConfig?.keys || [config.defaultKeys[0]]).map((key) => ({
70643
- kind: graphql12.Kind.FIELD,
70570
+ kind: graphql13.Kind.FIELD,
70644
70571
  name: {
70645
- kind: graphql12.Kind.NAME,
70572
+ kind: graphql13.Kind.NAME,
70646
70573
  value: key
70647
70574
  }
70648
70575
  })),
@@ -70699,15 +70626,15 @@ function replaceArgumentsWithVariables(args, flags) {
70699
70626
  }
70700
70627
  function variableAsArgument(name, variable) {
70701
70628
  return {
70702
- kind: graphql12.Kind.ARGUMENT,
70629
+ kind: graphql13.Kind.ARGUMENT,
70703
70630
  name: {
70704
- kind: graphql12.Kind.NAME,
70631
+ kind: graphql13.Kind.NAME,
70705
70632
  value: name
70706
70633
  },
70707
70634
  value: {
70708
- kind: graphql12.Kind.VARIABLE,
70635
+ kind: graphql13.Kind.VARIABLE,
70709
70636
  name: {
70710
- kind: graphql12.Kind.NAME,
70637
+ kind: graphql13.Kind.NAME,
70711
70638
  value: variable ?? name
70712
70639
  }
70713
70640
  }
@@ -70715,18 +70642,18 @@ function variableAsArgument(name, variable) {
70715
70642
  }
70716
70643
  function staticVariableDefinition(name, type, defaultValue, variableName) {
70717
70644
  return {
70718
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70645
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70719
70646
  type: {
70720
- kind: graphql12.Kind.NAMED_TYPE,
70647
+ kind: graphql13.Kind.NAMED_TYPE,
70721
70648
  name: {
70722
- kind: graphql12.Kind.NAME,
70649
+ kind: graphql13.Kind.NAME,
70723
70650
  value: type
70724
70651
  }
70725
70652
  },
70726
70653
  variable: {
70727
- kind: graphql12.Kind.VARIABLE,
70654
+ kind: graphql13.Kind.VARIABLE,
70728
70655
  name: {
70729
- kind: graphql12.Kind.NAME,
70656
+ kind: graphql13.Kind.NAME,
70730
70657
  value: variableName ?? name
70731
70658
  }
70732
70659
  },
@@ -70738,9 +70665,9 @@ function staticVariableDefinition(name, type, defaultValue, variableName) {
70738
70665
  }
70739
70666
  function argumentNode(name, value) {
70740
70667
  return {
70741
- kind: graphql12.Kind.ARGUMENT,
70668
+ kind: graphql13.Kind.ARGUMENT,
70742
70669
  name: {
70743
- kind: graphql12.Kind.NAME,
70670
+ kind: graphql13.Kind.NAME,
70744
70671
  value: name
70745
70672
  },
70746
70673
  value: objectNode(value)
@@ -70748,16 +70675,16 @@ function argumentNode(name, value) {
70748
70675
  }
70749
70676
  function objectNode([type, defaultValue]) {
70750
70677
  const node = {
70751
- kind: graphql12.Kind.OBJECT,
70678
+ kind: graphql13.Kind.OBJECT,
70752
70679
  fields: [
70753
70680
  {
70754
- kind: graphql12.Kind.OBJECT_FIELD,
70681
+ kind: graphql13.Kind.OBJECT_FIELD,
70755
70682
  name: {
70756
- kind: graphql12.Kind.NAME,
70683
+ kind: graphql13.Kind.NAME,
70757
70684
  value: "type"
70758
70685
  },
70759
70686
  value: {
70760
- kind: graphql12.Kind.STRING,
70687
+ kind: graphql13.Kind.STRING,
70761
70688
  value: type
70762
70689
  }
70763
70690
  }
@@ -70765,8 +70692,8 @@ function objectNode([type, defaultValue]) {
70765
70692
  };
70766
70693
  if (defaultValue) {
70767
70694
  node.fields.push({
70768
- kind: graphql12.Kind.OBJECT_FIELD,
70769
- name: { kind: graphql12.Kind.NAME, value: "default" },
70695
+ kind: graphql13.Kind.OBJECT_FIELD,
70696
+ name: { kind: graphql13.Kind.NAME, value: "default" },
70770
70697
  value: {
70771
70698
  kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
70772
70699
  value: defaultValue.toString()
@@ -70777,34 +70704,34 @@ function objectNode([type, defaultValue]) {
70777
70704
  }
70778
70705
  var pageInfoSelection = [
70779
70706
  {
70780
- kind: graphql12.Kind.FIELD,
70707
+ kind: graphql13.Kind.FIELD,
70781
70708
  name: {
70782
- kind: graphql12.Kind.NAME,
70709
+ kind: graphql13.Kind.NAME,
70783
70710
  value: "edges"
70784
70711
  },
70785
70712
  selectionSet: {
70786
- kind: graphql12.Kind.SELECTION_SET,
70713
+ kind: graphql13.Kind.SELECTION_SET,
70787
70714
  selections: [
70788
70715
  {
70789
- kind: graphql12.Kind.FIELD,
70716
+ kind: graphql13.Kind.FIELD,
70790
70717
  name: {
70791
- kind: graphql12.Kind.NAME,
70718
+ kind: graphql13.Kind.NAME,
70792
70719
  value: "cursor"
70793
70720
  }
70794
70721
  },
70795
70722
  {
70796
- kind: graphql12.Kind.FIELD,
70723
+ kind: graphql13.Kind.FIELD,
70797
70724
  name: {
70798
- kind: graphql12.Kind.NAME,
70725
+ kind: graphql13.Kind.NAME,
70799
70726
  value: "node"
70800
70727
  },
70801
70728
  selectionSet: {
70802
- kind: graphql12.Kind.SELECTION_SET,
70729
+ kind: graphql13.Kind.SELECTION_SET,
70803
70730
  selections: [
70804
70731
  {
70805
- kind: graphql12.Kind.FIELD,
70732
+ kind: graphql13.Kind.FIELD,
70806
70733
  name: {
70807
- kind: graphql12.Kind.NAME,
70734
+ kind: graphql13.Kind.NAME,
70808
70735
  value: "__typename"
70809
70736
  }
70810
70737
  }
@@ -70815,39 +70742,39 @@ var pageInfoSelection = [
70815
70742
  }
70816
70743
  },
70817
70744
  {
70818
- kind: graphql12.Kind.FIELD,
70745
+ kind: graphql13.Kind.FIELD,
70819
70746
  name: {
70820
- kind: graphql12.Kind.NAME,
70747
+ kind: graphql13.Kind.NAME,
70821
70748
  value: "pageInfo"
70822
70749
  },
70823
70750
  selectionSet: {
70824
- kind: graphql12.Kind.SELECTION_SET,
70751
+ kind: graphql13.Kind.SELECTION_SET,
70825
70752
  selections: [
70826
70753
  {
70827
- kind: graphql12.Kind.FIELD,
70754
+ kind: graphql13.Kind.FIELD,
70828
70755
  name: {
70829
- kind: graphql12.Kind.NAME,
70756
+ kind: graphql13.Kind.NAME,
70830
70757
  value: "hasPreviousPage"
70831
70758
  }
70832
70759
  },
70833
70760
  {
70834
- kind: graphql12.Kind.FIELD,
70761
+ kind: graphql13.Kind.FIELD,
70835
70762
  name: {
70836
- kind: graphql12.Kind.NAME,
70763
+ kind: graphql13.Kind.NAME,
70837
70764
  value: "hasNextPage"
70838
70765
  }
70839
70766
  },
70840
70767
  {
70841
- kind: graphql12.Kind.FIELD,
70768
+ kind: graphql13.Kind.FIELD,
70842
70769
  name: {
70843
- kind: graphql12.Kind.NAME,
70770
+ kind: graphql13.Kind.NAME,
70844
70771
  value: "startCursor"
70845
70772
  }
70846
70773
  },
70847
70774
  {
70848
- kind: graphql12.Kind.FIELD,
70775
+ kind: graphql13.Kind.FIELD,
70849
70776
  name: {
70850
- kind: graphql12.Kind.NAME,
70777
+ kind: graphql13.Kind.NAME,
70851
70778
  value: "endCursor"
70852
70779
  }
70853
70780
  }
@@ -70861,17 +70788,17 @@ async function addListFragments(config, documents) {
70861
70788
  const lists = {};
70862
70789
  const errors = [];
70863
70790
  for (const doc of documents) {
70864
- doc.document = graphql13.visit(doc.document, {
70791
+ doc.document = graphql14.visit(doc.document, {
70865
70792
  Directive(node, key, parent2, path3, ancestors) {
70866
70793
  if ([config.listDirective, config.paginateDirective].includes(node.name.value)) {
70867
70794
  const nameArg = node.arguments?.find(
70868
70795
  (arg) => arg.name.value === config.listOrPaginateNameArg
70869
70796
  );
70870
70797
  let error = {
70871
- ...new graphql13.GraphQLError(
70798
+ ...new graphql14.GraphQLError(
70872
70799
  "",
70873
70800
  node,
70874
- new graphql13.Source(""),
70801
+ new graphql14.Source(""),
70875
70802
  node.loc ? [node.loc.start, node.loc.end] : null,
70876
70803
  path3
70877
70804
  ),
@@ -70923,7 +70850,7 @@ async function addListFragments(config, documents) {
70923
70850
  {
70924
70851
  kind: "Argument",
70925
70852
  name: {
70926
- kind: graphql13.Kind.NAME,
70853
+ kind: graphql14.Kind.NAME,
70927
70854
  value: "connection"
70928
70855
  },
70929
70856
  value: {
@@ -70973,7 +70900,7 @@ async function addListFragments(config, documents) {
70973
70900
  const validDeletes = [
70974
70901
  ...new Set(
70975
70902
  Object.values(lists).map(({ type }) => {
70976
- if (!(type instanceof graphql13.GraphQLObjectType)) {
70903
+ if (!(type instanceof graphql14.GraphQLObjectType)) {
70977
70904
  return "";
70978
70905
  }
70979
70906
  if (config.keyFieldsForType(type.name).length !== 1) {
@@ -70987,7 +70914,7 @@ async function addListFragments(config, documents) {
70987
70914
  return;
70988
70915
  }
70989
70916
  const generatedDoc = {
70990
- kind: graphql13.Kind.DOCUMENT,
70917
+ kind: graphql14.Kind.DOCUMENT,
70991
70918
  definitions: Object.entries(lists).flatMap(
70992
70919
  ([name, { selection, type }]) => {
70993
70920
  const schemaType = config.schema.getType(type.name);
@@ -70995,7 +70922,7 @@ async function addListFragments(config, documents) {
70995
70922
  throw new HoudiniError({ message: "Lists must have a selection" });
70996
70923
  }
70997
70924
  const fragmentSelection = {
70998
- kind: graphql13.Kind.SELECTION_SET,
70925
+ kind: graphql14.Kind.SELECTION_SET,
70999
70926
  selections: [...selection.selections]
71000
70927
  };
71001
70928
  if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
@@ -71010,14 +70937,14 @@ async function addListFragments(config, documents) {
71010
70937
  {
71011
70938
  name: {
71012
70939
  value: config.listInsertFragment(name),
71013
- kind: graphql13.Kind.NAME
70940
+ kind: graphql14.Kind.NAME
71014
70941
  },
71015
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
70942
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
71016
70943
  selectionSet: fragmentSelection,
71017
70944
  typeCondition: {
71018
- kind: graphql13.Kind.NAMED_TYPE,
70945
+ kind: graphql14.Kind.NAMED_TYPE,
71019
70946
  name: {
71020
- kind: graphql13.Kind.NAME,
70947
+ kind: graphql14.Kind.NAME,
71021
70948
  value: type.name
71022
70949
  }
71023
70950
  }
@@ -71025,32 +70952,32 @@ async function addListFragments(config, documents) {
71025
70952
  {
71026
70953
  name: {
71027
70954
  value: config.listToggleFragment(name),
71028
- kind: graphql13.Kind.NAME
70955
+ kind: graphql14.Kind.NAME
71029
70956
  },
71030
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
70957
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
71031
70958
  selectionSet: fragmentSelection,
71032
70959
  typeCondition: {
71033
- kind: graphql13.Kind.NAMED_TYPE,
70960
+ kind: graphql14.Kind.NAMED_TYPE,
71034
70961
  name: {
71035
- kind: graphql13.Kind.NAME,
70962
+ kind: graphql14.Kind.NAME,
71036
70963
  value: type.name
71037
70964
  }
71038
70965
  }
71039
70966
  },
71040
70967
  {
71041
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
70968
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
71042
70969
  name: {
71043
70970
  value: config.listRemoveFragment(name),
71044
- kind: graphql13.Kind.NAME
70971
+ kind: graphql14.Kind.NAME
71045
70972
  },
71046
70973
  selectionSet: {
71047
- kind: graphql13.Kind.SELECTION_SET,
70974
+ kind: graphql14.Kind.SELECTION_SET,
71048
70975
  selections: [...objectIdentificationSelection(config, type)]
71049
70976
  },
71050
70977
  typeCondition: {
71051
- kind: graphql13.Kind.NAMED_TYPE,
70978
+ kind: graphql14.Kind.NAMED_TYPE,
71052
70979
  name: {
71053
- kind: graphql13.Kind.NAME,
70980
+ kind: graphql14.Kind.NAME,
71054
70981
  value: type.name
71055
70982
  }
71056
70983
  }
@@ -71059,14 +70986,14 @@ async function addListFragments(config, documents) {
71059
70986
  }
71060
70987
  ).concat(
71061
70988
  ...validDeletes.map((typeName) => ({
71062
- kind: graphql13.Kind.DIRECTIVE_DEFINITION,
70989
+ kind: graphql14.Kind.DIRECTIVE_DEFINITION,
71063
70990
  name: {
71064
- kind: graphql13.Kind.NAME,
70991
+ kind: graphql14.Kind.NAME,
71065
70992
  value: config.listDeleteDirective(typeName)
71066
70993
  },
71067
70994
  locations: [
71068
70995
  {
71069
- kind: graphql13.Kind.NAME,
70996
+ kind: graphql14.Kind.NAME,
71070
70997
  value: "FIELD"
71071
70998
  }
71072
70999
  ],
@@ -71074,8 +71001,8 @@ async function addListFragments(config, documents) {
71074
71001
  }))
71075
71002
  )
71076
71003
  };
71077
- config.newSchema += "\n" + generatedDoc.definitions.filter((c2) => c2.kind !== "FragmentDefinition").map(graphql13.print).join("\n\n");
71078
- config.newDocuments += "\n" + generatedDoc.definitions.filter((c2) => c2.kind === "FragmentDefinition").map(graphql13.print).join("\n\n");
71004
+ config.newSchema += "\n" + generatedDoc.definitions.filter((c2) => c2.kind !== "FragmentDefinition").map(graphql14.print).join("\n\n");
71005
+ config.newDocuments += "\n" + generatedDoc.definitions.filter((c2) => c2.kind === "FragmentDefinition").map(graphql14.print).join("\n\n");
71079
71006
  documents.push({
71080
71007
  name: "generated::lists",
71081
71008
  kind: ArtifactKind.Fragment,
@@ -71161,11 +71088,11 @@ var nodeNotDefinedMessage = (config) => `Looks like you are trying to use the ${
71161
71088
  For more information, visit this link: ${siteURL}/guides/pagination`;
71162
71089
 
71163
71090
  // src/codegen/generators/artifacts/fieldKey.ts
71164
- var graphql14 = __toESM(require("graphql"), 1);
71091
+ var graphql15 = __toESM(require("graphql"), 1);
71165
71092
  function fieldKey(config, field) {
71166
71093
  const attributeName = field.alias?.value || field.name.value;
71167
- const printed = graphql14.print(field);
71168
- const secondParse = graphql14.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
71094
+ const printed = graphql15.print(field);
71095
+ const secondParse = graphql15.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
71169
71096
  let paginateMode = config.defaultPaginateMode;
71170
71097
  const paginatedDirective = field.directives?.find(
71171
71098
  (directive) => directive.name.value === config.paginateDirective
@@ -71288,13 +71215,13 @@ function prepareSelection({
71288
71215
  } else if ("getFields" in type) {
71289
71216
  let typeRef = type.getFields()[field.name.value].type;
71290
71217
  fieldType = getRootType(typeRef);
71291
- nullable = !graphql15.isNonNullType(typeRef);
71292
- } else if (graphql15.isAbstractType(type)) {
71218
+ nullable = !graphql16.isNonNullType(typeRef);
71219
+ } else if (graphql16.isAbstractType(type)) {
71293
71220
  for (const possible of config.schema.getPossibleTypes(type)) {
71294
- if (graphql15.isObjectType(possible)) {
71221
+ if (graphql16.isObjectType(possible)) {
71295
71222
  if (possible.getFields()[field.name.value]) {
71296
71223
  fieldType = possible.getFields()[field.name.value].type;
71297
- nullable = !graphql15.isNonNullType(fieldType);
71224
+ nullable = !graphql16.isNonNullType(fieldType);
71298
71225
  break;
71299
71226
  }
71300
71227
  }
@@ -71431,7 +71358,7 @@ function prepareSelection({
71431
71358
  kind: "value"
71432
71359
  } : { kind: "continue" };
71433
71360
  const parentType = config.schema.getType(rootType);
71434
- if (graphql15.isObjectType(parentType) || graphql15.isInterfaceType(parentType)) {
71361
+ if (graphql16.isObjectType(parentType) || graphql16.isInterfaceType(parentType)) {
71435
71362
  const fieldType2 = parentType.getFields()[field.name.value]?.type;
71436
71363
  if (fieldType2) {
71437
71364
  const listCount = unwrapType(config, fieldType2).wrappers.filter(
@@ -71454,7 +71381,7 @@ function prepareSelection({
71454
71381
  }
71455
71382
  fieldObj.loading = loadingValue;
71456
71383
  }
71457
- if (graphql15.isInterfaceType(fieldType) || graphql15.isUnionType(fieldType)) {
71384
+ if (graphql16.isInterfaceType(fieldType) || graphql16.isUnionType(fieldType)) {
71458
71385
  fieldObj.abstract = true;
71459
71386
  if (Object.values(fieldObj.selection?.abstractFields?.fields ?? {}).some(
71460
71387
  (fields) => Object.values(fields ?? {}).some((field2) => field2.required)
@@ -71536,7 +71463,7 @@ function mergeSelection({
71536
71463
  typeSelection,
71537
71464
  abstractSelection.fields[typeName] ?? {}
71538
71465
  );
71539
- if (graphql15.isAbstractType(gqlType)) {
71466
+ if (graphql16.isAbstractType(gqlType)) {
71540
71467
  for (const possible of config.schema.getPossibleTypes(gqlType)) {
71541
71468
  if (!possibleSelectionTypes[typeName]) {
71542
71469
  possibleSelectionTypes[typeName] = [];
@@ -71571,7 +71498,7 @@ function mergeSelection({
71571
71498
  }
71572
71499
  }
71573
71500
  const parentType = config.schema.getType(rootType);
71574
- const possibleParents = graphql15.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t3) => t3.name) : [parentType.name];
71501
+ const possibleParents = graphql16.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t3) => t3.name) : [parentType.name];
71575
71502
  for (const key of Object.keys(abstractSelection.typeMap)) {
71576
71503
  if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
71577
71504
  delete abstractSelection.typeMap[key];
@@ -71628,12 +71555,12 @@ function mergeSelection({
71628
71555
  }
71629
71556
 
71630
71557
  // src/codegen/generators/artifacts/index.ts
71631
- var AST4 = recast4.types.builders;
71558
+ var AST5 = recast5.types.builders;
71632
71559
  function artifactGenerator(stats) {
71633
71560
  return async function(config, docs) {
71634
71561
  const filterTypes = {};
71635
71562
  for (const doc of docs) {
71636
- graphql16.visit(doc.document, {
71563
+ graphql17.visit(doc.document, {
71637
71564
  Directive(node, _3, __, ___, ancestors) {
71638
71565
  if (node.name.value !== config.listDirective) {
71639
71566
  return;
@@ -71693,7 +71620,7 @@ function artifactGenerator(stats) {
71693
71620
  return;
71694
71621
  }
71695
71622
  const usedVariableNames = /* @__PURE__ */ new Set();
71696
- let documentWithoutInternalDirectives = graphql16.visit(document, {
71623
+ let documentWithoutInternalDirectives = graphql17.visit(document, {
71697
71624
  Directive(node) {
71698
71625
  if (config.isInternalDirective(node.name.value)) {
71699
71626
  return null;
@@ -71706,7 +71633,7 @@ function artifactGenerator(stats) {
71706
71633
  }
71707
71634
  }
71708
71635
  });
71709
- let documentWithoutExtraVariables = graphql16.visit(
71636
+ let documentWithoutExtraVariables = graphql17.visit(
71710
71637
  documentWithoutInternalDirectives,
71711
71638
  {
71712
71639
  VariableDefinition(variableDefinitionNode) {
@@ -71717,13 +71644,13 @@ function artifactGenerator(stats) {
71717
71644
  }
71718
71645
  }
71719
71646
  );
71720
- let rawString = graphql16.print(documentWithoutExtraVariables);
71647
+ let rawString = graphql17.print(documentWithoutExtraVariables);
71721
71648
  let docKind = doc.kind;
71722
71649
  const operations = document.definitions.filter(
71723
- ({ kind }) => kind === graphql16.Kind.OPERATION_DEFINITION
71650
+ ({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
71724
71651
  );
71725
71652
  const fragments = document.definitions.filter(
71726
- ({ kind }) => kind === graphql16.Kind.FRAGMENT_DEFINITION
71653
+ ({ kind }) => kind === graphql17.Kind.FRAGMENT_DEFINITION
71727
71654
  );
71728
71655
  let rootType = "";
71729
71656
  let selectionSet;
@@ -71870,7 +71797,21 @@ function artifactGenerator(stats) {
71870
71797
  artifact.pluginData[plugin2.name] = plugin2.artifactData({ config, document: doc }) ?? {};
71871
71798
  }
71872
71799
  if (inputs && inputs.length > 0) {
71873
- artifact.input = inputObject(config, inputs);
71800
+ const runtimeScalars = inputs.reduce((prev, input) => {
71801
+ const runtimeScalarDirective = input.directives?.find(
71802
+ (directive2) => directive2.name.value === config.runtimeScalarDirective
71803
+ );
71804
+ if (!runtimeScalarDirective) {
71805
+ return prev;
71806
+ }
71807
+ return {
71808
+ ...prev,
71809
+ [input.variable.name.value]: runtimeScalarDirective.arguments?.find(
71810
+ (arg) => arg.name.value === "type"
71811
+ )?.value?.value
71812
+ };
71813
+ }, {});
71814
+ artifact.input = inputObject(config, inputs, runtimeScalars);
71874
71815
  }
71875
71816
  if (artifact.kind === "HoudiniQuery") {
71876
71817
  const cacheDirective = operations[0].directives?.find(
@@ -71909,9 +71850,9 @@ function artifactGenerator(stats) {
71909
71850
  plugin2.artifactEnd({ config, document: doc });
71910
71851
  }
71911
71852
  const _houdiniHash = hashOriginal({ document: doc });
71912
- const file = AST4.program([
71853
+ const file = AST5.program([
71913
71854
  moduleExport(config, "default", serializeValue(artifact)),
71914
- AST4.expressionStatement(AST4.stringLiteral(`HoudiniHash=${_houdiniHash}`))
71855
+ AST5.expressionStatement(AST5.stringLiteral(`HoudiniHash=${_houdiniHash}`))
71915
71856
  ]);
71916
71857
  const artifactPath = config.artifactPath(document);
71917
71858
  const countDocument = doc.generateStore;
@@ -71969,7 +71910,7 @@ function applyMask(config, target, mask) {
71969
71910
  if (!targetType) {
71970
71911
  continue;
71971
71912
  }
71972
- if (graphql16.isAbstractType(targetType)) {
71913
+ if (graphql17.isAbstractType(targetType)) {
71973
71914
  for (const possible of config.schema.getPossibleTypes(targetType)) {
71974
71915
  if (target.abstractFields?.fields[possible.name]) {
71975
71916
  applyMask(
@@ -71992,8 +71933,8 @@ function applyMask(config, target, mask) {
71992
71933
  }
71993
71934
 
71994
71935
  // src/codegen/generators/runtime/graphqlFunction.ts
71995
- var recast5 = __toESM(require_main2(), 1);
71996
- var AST5 = recast5.types.builders;
71936
+ var recast6 = __toESM(require_main2(), 1);
71937
+ var AST6 = recast6.types.builders;
71997
71938
  async function generateGraphqlReturnTypes(config, docs) {
71998
71939
  const indexPath = path_exports.join(config.runtimeDirectory, "index.d.ts");
71999
71940
  const fileContent = await fs_exports.readFile(indexPath) || "";
@@ -72028,18 +71969,18 @@ async function generateGraphqlReturnTypes(config, docs) {
72028
71969
  continue;
72029
71970
  }
72030
71971
  for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
72031
- const input = AST5.identifier("str");
72032
- input.typeAnnotation = AST5.tsTypeAnnotation(
72033
- AST5.tsLiteralType(AST5.stringLiteral(queryString))
71972
+ const input = AST6.identifier("str");
71973
+ input.typeAnnotation = AST6.tsTypeAnnotation(
71974
+ AST6.tsLiteralType(AST6.stringLiteral(queryString))
72034
71975
  );
72035
71976
  script.body.splice(
72036
71977
  i2,
72037
71978
  0,
72038
- AST5.exportNamedDeclaration(
72039
- AST5.tsDeclareFunction(
72040
- AST5.identifier("graphql"),
71979
+ AST6.exportNamedDeclaration(
71980
+ AST6.tsDeclareFunction(
71981
+ AST6.identifier("graphql"),
72041
71982
  [input],
72042
- AST5.tsTypeAnnotation(AST5.tsTypeReference(AST5.identifier(returnValue)))
71983
+ AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
72043
71984
  )
72044
71985
  )
72045
71986
  );
@@ -72214,165 +72155,22 @@ function moduleStatments(config) {
72214
72155
  var recast11 = __toESM(require_main2(), 1);
72215
72156
 
72216
72157
  // src/codegen/generators/typescript/addReferencedInputTypes.ts
72217
- var graphql19 = __toESM(require("graphql"), 1);
72218
- var recast8 = __toESM(require_main2(), 1);
72219
-
72220
- // src/codegen/generators/typescript/typeReference.ts
72221
72158
  var graphql18 = __toESM(require("graphql"), 1);
72222
72159
  var recast7 = __toESM(require_main2(), 1);
72223
-
72224
- // src/codegen/generators/typescript/types.ts
72225
- var graphql17 = __toESM(require("graphql"), 1);
72226
- var recast6 = __toESM(require_main2(), 1);
72227
- var AST6 = recast6.types.builders;
72228
- function readonlyProperty(prop, enable = true) {
72229
- if (enable) {
72230
- prop.readonly = true;
72231
- }
72232
- return prop;
72233
- }
72234
- function nullableField(inner, input = false) {
72235
- const members = [inner, AST6.tsNullKeyword()];
72236
- if (input) {
72237
- members.push(AST6.tsUndefinedKeyword());
72238
- }
72239
- return AST6.tsUnionType(members);
72240
- }
72241
- function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
72242
- if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
72243
- if (!field) {
72244
- return AST6.tsNeverKeyword();
72245
- }
72246
- const component = config.componentFields[field.parent][field.field];
72247
- const sourcePathRelative = path_exports.relative(
72248
- path_exports.join(config.projectRoot, "src"),
72249
- component.filepath
72250
- );
72251
- let sourcePathParsed = path_exports.parse(sourcePathRelative);
72252
- let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
72253
- const localImport = ensureImports({
72254
- config,
72255
- body,
72256
- import: "__component__" + component.fragment,
72257
- sourceModule: path_exports.join(
72258
- path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
72259
- "src",
72260
- sourcePath
72261
- )
72262
- });
72263
- const parameters = AST6.tsTypeReference(AST6.identifier("Parameters"));
72264
- parameters.typeParameters = AST6.tsTypeParameterInstantiation([
72265
- AST6.tsTypeQuery(AST6.identifier(localImport))
72266
- ]);
72267
- const indexed = AST6.tsIndexedAccessType(
72268
- parameters,
72269
- AST6.tsLiteralType(AST6.numericLiteral(0))
72270
- );
72271
- const omit = AST6.tsTypeReference(AST6.identifier("Omit"));
72272
- omit.typeParameters = AST6.tsTypeParameterInstantiation([
72273
- indexed,
72274
- AST6.tsLiteralType(AST6.stringLiteral(component.prop))
72275
- ]);
72276
- const arg = AST6.identifier("props");
72277
- arg.typeAnnotation = AST6.tsTypeAnnotation(omit);
72278
- const returnType = AST6.tsTypeReference(AST6.identifier("ReturnType"));
72279
- returnType.typeParameters = AST6.tsTypeParameterInstantiation([
72280
- AST6.tsTypeQuery(AST6.identifier(localImport))
72281
- ]);
72282
- const fnType = AST6.tsFunctionType([arg]);
72283
- fnType.typeAnnotation = AST6.tsTypeAnnotation(returnType);
72284
- return fnType;
72285
- }
72286
- switch (target.name) {
72287
- case "String": {
72288
- return AST6.tsStringKeyword();
72289
- }
72290
- case "Int": {
72291
- return AST6.tsNumberKeyword();
72292
- }
72293
- case "Float": {
72294
- return AST6.tsNumberKeyword();
72295
- }
72296
- case "Boolean": {
72297
- return AST6.tsBooleanKeyword();
72298
- }
72299
- case "ID": {
72300
- return AST6.tsStringKeyword();
72301
- }
72302
- default: {
72303
- if (graphql17.isNonNullType(target) && "ofType" in target) {
72304
- return scalarPropertyValue(
72305
- config,
72306
- filepath,
72307
- missingScalars,
72308
- target.ofType,
72309
- body,
72310
- field
72311
- );
72312
- }
72313
- if (config.scalars?.[target.name]) {
72314
- return AST6.tsTypeReference(AST6.identifier(config.scalars?.[target.name].type));
72315
- }
72316
- if (target.name !== config.componentScalar) {
72317
- missingScalars.add(target.name);
72318
- }
72319
- return AST6.tsAnyKeyword();
72320
- }
72321
- }
72322
- }
72323
-
72324
- // src/codegen/generators/typescript/typeReference.ts
72325
72160
  var AST7 = recast7.types.builders;
72326
- function tsTypeReference(config, filepath, missingScalars, definition, body) {
72327
- const { type, wrappers } = unwrapType(config, definition.type);
72328
- let result;
72329
- if (graphql18.isScalarType(type)) {
72330
- result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
72331
- } else if (graphql18.isEnumType(type)) {
72332
- result = enumReference(config, body, type.name);
72333
- } else {
72334
- result = AST7.tsTypeReference(AST7.identifier(type.name));
72335
- }
72336
- for (const toWrap of wrappers) {
72337
- if (toWrap === "NonNull" /* NonNull */) {
72338
- continue;
72339
- } else if (toWrap === "Nullable" /* Nullable */) {
72340
- result = nullableField(result, true);
72341
- } else if (toWrap === "List" /* List */) {
72342
- result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
72343
- }
72344
- }
72345
- return result;
72346
- }
72347
- function enumReference(config, body, name) {
72348
- ensureImports({
72349
- config,
72350
- body,
72351
- import: ["ValueOf"],
72352
- importKind: "type",
72353
- sourceModule: "$houdini/runtime/lib/types"
72354
- });
72355
- return AST7.tsTypeReference(
72356
- AST7.identifier("ValueOf"),
72357
- AST7.tsTypeParameterInstantiation([AST7.tsTypeQuery(AST7.identifier(name))])
72358
- );
72359
- }
72360
-
72361
- // src/codegen/generators/typescript/addReferencedInputTypes.ts
72362
- var AST8 = recast8.types.builders;
72363
72161
  function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
72364
72162
  const { type } = unwrapType(config, rootType);
72365
- if (graphql19.isScalarType(type)) {
72163
+ if (graphql18.isScalarType(type)) {
72366
72164
  return;
72367
72165
  }
72368
72166
  if (visitedTypes.has(type.name)) {
72369
72167
  return;
72370
72168
  }
72371
- if (graphql19.isUnionType(type)) {
72169
+ if (graphql18.isUnionType(type)) {
72372
72170
  throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
72373
72171
  }
72374
72172
  visitedTypes.add(type.name);
72375
- if (graphql19.isEnumType(type)) {
72173
+ if (graphql18.isEnumType(type)) {
72376
72174
  ensureImports({
72377
72175
  config,
72378
72176
  body,
@@ -72386,21 +72184,37 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
72386
72184
  for (const field of Object.values(type.getFields())) {
72387
72185
  addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
72388
72186
  members.push(
72389
- AST8.tsPropertySignature(
72390
- AST8.identifier(field.name),
72391
- AST8.tsTypeAnnotation(
72187
+ AST7.tsPropertySignature(
72188
+ AST7.identifier(field.name),
72189
+ AST7.tsTypeAnnotation(
72392
72190
  tsTypeReference(config, filepath, missingScalars, field, body)
72393
72191
  ),
72394
- graphql19.isNullableType(field.type)
72192
+ graphql18.isNullableType(field.type)
72395
72193
  )
72396
72194
  );
72397
72195
  }
72398
- body.push(AST8.tsTypeAliasDeclaration(AST8.identifier(type.name), AST8.tsTypeLiteral(members)));
72196
+ body.push(AST7.tsTypeAliasDeclaration(AST7.identifier(type.name), AST7.tsTypeLiteral(members)));
72399
72197
  }
72400
72198
 
72401
72199
  // src/codegen/generators/typescript/inlineType.ts
72402
- var graphql20 = __toESM(require("graphql"), 1);
72200
+ var graphql19 = __toESM(require("graphql"), 1);
72403
72201
  var recast9 = __toESM(require_main2(), 1);
72202
+
72203
+ // src/codegen/generators/comments/jsdoc.ts
72204
+ var recast8 = __toESM(require_main2(), 1);
72205
+ var AST8 = recast8.types.builders;
72206
+ function jsdocComment(text, deprecated) {
72207
+ let commentContent = `*
72208
+ * ${text}
72209
+ `;
72210
+ if (deprecated) {
72211
+ commentContent = `${commentContent} * @deprecated ${deprecated}
72212
+ `;
72213
+ }
72214
+ return AST8.commentBlock(commentContent, true);
72215
+ }
72216
+
72217
+ // src/codegen/generators/typescript/inlineType.ts
72404
72218
  var AST9 = recast9.types.builders;
72405
72219
  var fragmentKey2 = " $fragments";
72406
72220
  function inlineType({
@@ -72421,7 +72235,7 @@ function inlineType({
72421
72235
  const { type, wrappers } = unwrapType(config, rootType);
72422
72236
  let result;
72423
72237
  let forceNullable = false;
72424
- if (graphql20.isScalarType(type)) {
72238
+ if (graphql19.isScalarType(type)) {
72425
72239
  result = scalarPropertyValue(
72426
72240
  config,
72427
72241
  filepath,
@@ -72430,7 +72244,7 @@ function inlineType({
72430
72244
  body,
72431
72245
  field
72432
72246
  );
72433
- } else if (graphql20.isEnumType(type)) {
72247
+ } else if (graphql19.isEnumType(type)) {
72434
72248
  ensureImports({
72435
72249
  config,
72436
72250
  body,
@@ -72455,11 +72269,11 @@ function inlineType({
72455
72269
  for (const selection of selections) {
72456
72270
  if (selection.kind === "InlineFragment" && selection.typeCondition) {
72457
72271
  const fragmentType = config.schema.getType(selection.typeCondition.name.value);
72458
- if (!graphql20.isInterfaceType(type) && !graphql20.isUnionType(type)) {
72272
+ if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
72459
72273
  selectedFields.push(...selection.selectionSet.selections);
72460
72274
  continue;
72461
72275
  }
72462
- if (!graphql20.isInterfaceType(fragmentType) && !graphql20.isUnionType(fragmentType)) {
72276
+ if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
72463
72277
  if (!inlineFragments[fragmentType.name]) {
72464
72278
  inlineFragments[fragmentType.name] = [];
72465
72279
  }
@@ -72551,6 +72365,11 @@ function inlineType({
72551
72365
  if (allOptional) {
72552
72366
  prop.optional = true;
72553
72367
  }
72368
+ if (field2.description || field2.deprecationReason) {
72369
+ prop.comments = [
72370
+ jsdocComment(field2.description ?? "", field2.deprecationReason ?? void 0)
72371
+ ];
72372
+ }
72554
72373
  return prop;
72555
72374
  })
72556
72375
  ]);
@@ -72602,7 +72421,7 @@ function inlineType({
72602
72421
  }
72603
72422
  }
72604
72423
  }
72605
- if (objectType.type === "TSTypeLiteral" && !graphql20.isInterfaceType(fragmentRootType) && !graphql20.isUnionType(fragmentRootType)) {
72424
+ if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
72606
72425
  const existingTypenameIndex = objectType.members.findIndex(
72607
72426
  (member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
72608
72427
  );
@@ -72627,11 +72446,11 @@ function inlineType({
72627
72446
  ];
72628
72447
  }
72629
72448
  let coveredTypenames;
72630
- if (graphql20.isInterfaceType(fragmentRootType)) {
72449
+ if (graphql19.isInterfaceType(fragmentRootType)) {
72631
72450
  coveredTypenames = interfaceCoveredTypenames(fragmentRootType);
72632
- } else if (graphql20.isUnionType(fragmentRootType)) {
72451
+ } else if (graphql19.isUnionType(fragmentRootType)) {
72633
72452
  coveredTypenames = fragmentRootType.getTypes().map((type2) => type2.name);
72634
- } else if (graphql20.isObjectType(fragmentRootType)) {
72453
+ } else if (graphql19.isObjectType(fragmentRootType)) {
72635
72454
  coveredTypenames = [fragmentRootType.name];
72636
72455
  } else {
72637
72456
  throw Error("unreachable code");
@@ -72667,7 +72486,7 @@ function inlineType({
72667
72486
  );
72668
72487
  }
72669
72488
  );
72670
- const parentIsUnionOrInterface = !graphql20.isInterfaceType(type) && !graphql20.isUnionType(type);
72489
+ const parentIsUnionOrInterface = !graphql19.isInterfaceType(type) && !graphql19.isUnionType(type);
72671
72490
  const possibleTypenames = parentIsUnionOrInterface ? [parent.name] : config.schema.getPossibleTypes(type).map((type2) => type2.name);
72672
72491
  const coveredTypenames = new Set(
72673
72492
  Object.values(inlineFragmentSelections).flatMap((sel) => sel.coveredTypenames)
@@ -72734,7 +72553,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
72734
72553
  },
72735
72554
  type: schema.getType("String")
72736
72555
  };
72737
- } else if (graphql20.isNonNullType(rootType) && "getFields" in rootType.ofType) {
72556
+ } else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
72738
72557
  fields = rootType.ofType.getFields();
72739
72558
  } else {
72740
72559
  fields = rootType.getFields();
@@ -72746,7 +72565,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
72746
72565
  message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
72747
72566
  });
72748
72567
  }
72749
- const fieldType = graphql20.getNamedType(field.type);
72568
+ const fieldType = graphql19.getNamedType(field.type);
72750
72569
  if (!fieldType) {
72751
72570
  throw new HoudiniError({
72752
72571
  filepath,
@@ -72962,17 +72781,20 @@ export * from "${module2}"
72962
72781
  }
72963
72782
  }
72964
72783
  await fs_exports.writeFile(config.typeIndexPath, indexContent);
72965
- if (missingScalars.size > 0) {
72966
- console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[...missingScalars].join(
72967
- ", "
72968
- )}
72784
+ const missingScalarNames = [...missingScalars].filter(
72785
+ (scalar) => !config.configFile.features?.runtimeScalars?.[scalar]
72786
+ );
72787
+ if (missingScalarNames.length > 0) {
72788
+ console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[
72789
+ ...missingScalarNames
72790
+ ].join(", ")}
72969
72791
  Generated types will contain an any type in place of these values. To fix this, provide an equivalent
72970
72792
  type in your config file:
72971
72793
 
72972
72794
  {
72973
72795
  scalars: {
72974
72796
  ${cyan2(`/* in your case, something like */`)}
72975
- ${[...missingScalars].map(
72797
+ ${[...missingScalarNames].map(
72976
72798
  (c2) => ` ${c2}: { ${green2(`// <- The GraphQL Scalar`)}
72977
72799
  type: "${cyan2(`YourType_${c2}`)}" ${green2(`// <- The TypeScript type`)}
72978
72800
  }`
@@ -73251,7 +73073,7 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
73251
73073
  }
73252
73074
 
73253
73075
  // src/codegen/generators/typescript/imperativeTypeDef.ts
73254
- var graphql21 = __toESM(require("graphql"), 1);
73076
+ var graphql20 = __toESM(require("graphql"), 1);
73255
73077
  var recast12 = __toESM(require_main2(), 1);
73256
73078
  var AST12 = recast12.types.builders;
73257
73079
  async function imperativeCacheTypef(config, docs) {
@@ -73303,7 +73125,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73303
73125
  const operationTypes = [config.schema.getMutationType(), config.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
73304
73126
  const visitedTypes = /* @__PURE__ */ new Set();
73305
73127
  const types16 = Object.values(config.schema.getTypeMap()).filter(
73306
- (type) => !graphql21.isAbstractType(type) && !graphql21.isScalarType(type) && !graphql21.isEnumType(type) && !graphql21.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
73128
+ (type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
73307
73129
  );
73308
73130
  const fragmentMap = fragmentListMap(
73309
73131
  config,
@@ -73320,7 +73142,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73320
73142
  }
73321
73143
  let idFields = AST12.tsNeverKeyword();
73322
73144
  const keys2 = keyFieldsForType(config.configFile, type.name);
73323
- if (graphql21.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
73145
+ if (graphql20.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
73324
73146
  idFields = AST12.tsTypeLiteral(
73325
73147
  keys2.map((key) => {
73326
73148
  const fieldType = type.getFields()[key];
@@ -73347,13 +73169,13 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73347
73169
  idFields = AST12.tsTypeLiteral([]);
73348
73170
  }
73349
73171
  let fields = AST12.tsTypeLiteral([]);
73350
- if (graphql21.isObjectType(type)) {
73172
+ if (graphql20.isObjectType(type)) {
73351
73173
  fields = AST12.tsTypeLiteral(
73352
73174
  Object.entries(type.getFields()).map(
73353
73175
  ([key, fieldType]) => {
73354
73176
  const unwrapped = unwrapType(config, fieldType.type);
73355
73177
  let typeOptions = AST12.tsUnionType([]);
73356
- if (graphql21.isScalarType(unwrapped.type)) {
73178
+ if (graphql20.isScalarType(unwrapped.type)) {
73357
73179
  typeOptions.types.push(
73358
73180
  scalarPropertyValue(
73359
73181
  config,
@@ -73367,11 +73189,11 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73367
73189
  }
73368
73190
  )
73369
73191
  );
73370
- } else if (graphql21.isEnumType(unwrapped.type)) {
73192
+ } else if (graphql20.isEnumType(unwrapped.type)) {
73371
73193
  typeOptions.types.push(
73372
73194
  AST12.tsTypeReference(AST12.identifier(unwrapped.type.name))
73373
73195
  );
73374
- } else if (!graphql21.isAbstractType(unwrapped.type)) {
73196
+ } else if (!graphql20.isAbstractType(unwrapped.type)) {
73375
73197
  typeOptions.types.push(record(unwrapped.type.name));
73376
73198
  } else {
73377
73199
  typeOptions.types.push(
@@ -73467,7 +73289,7 @@ function listDefinitions(config, filepath, body, docs) {
73467
73289
  const lists = [];
73468
73290
  const visitedLists = /* @__PURE__ */ new Set();
73469
73291
  for (const doc of docs) {
73470
- graphql21.visit(doc.document, {
73292
+ graphql20.visit(doc.document, {
73471
73293
  Directive(node, key, parent2, path3, ancestors) {
73472
73294
  if (![config.listDirective, config.paginateDirective].includes(node.name.value)) {
73473
73295
  return;
@@ -73489,7 +73311,7 @@ function listDefinitions(config, filepath, body, docs) {
73489
73311
  const targetFieldDefinition = parentType.getFields()[targetField.name.value];
73490
73312
  const { type: listType } = unwrapType(config, targetFieldDefinition.type);
73491
73313
  const possibleTypes = [];
73492
- if (graphql21.isAbstractType(listType)) {
73314
+ if (graphql20.isAbstractType(listType)) {
73493
73315
  possibleTypes.push(
73494
73316
  ...config.schema.getPossibleTypes(listType).map((possible) => possible.name)
73495
73317
  );
@@ -73651,7 +73473,7 @@ async function typescriptGenerator(config, docs) {
73651
73473
  }
73652
73474
 
73653
73475
  // src/codegen/generators/persistedQueries/index.ts
73654
- var graphql22 = __toESM(require("graphql"), 1);
73476
+ var graphql21 = __toESM(require("graphql"), 1);
73655
73477
  async function persistOutputGenerator(config, docs) {
73656
73478
  if (!config.persistedQueriesPath.endsWith(".json")) {
73657
73479
  throw new Error('Can write Persisted Queries only in a ".json" file.');
@@ -73661,8 +73483,8 @@ async function persistOutputGenerator(config, docs) {
73661
73483
  if (!generateArtifact) {
73662
73484
  return acc;
73663
73485
  }
73664
- let rawString = graphql22.print(
73665
- graphql22.visit(document, {
73486
+ let rawString = graphql21.print(
73487
+ graphql21.visit(document, {
73666
73488
  Directive(node) {
73667
73489
  if (config.isInternalDirective(node.name.value)) {
73668
73490
  return null;
@@ -73671,7 +73493,7 @@ async function persistOutputGenerator(config, docs) {
73671
73493
  })
73672
73494
  );
73673
73495
  const operations = document.definitions.filter(
73674
- ({ kind }) => kind === graphql22.Kind.OPERATION_DEFINITION
73496
+ ({ kind }) => kind === graphql21.Kind.OPERATION_DEFINITION
73675
73497
  );
73676
73498
  if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
73677
73499
  if (artifact) {
@@ -73686,33 +73508,45 @@ async function persistOutputGenerator(config, docs) {
73686
73508
  }
73687
73509
 
73688
73510
  // src/codegen/generators/definitions/index.ts
73689
- var graphql24 = __toESM(require("graphql"), 1);
73511
+ var graphql23 = __toESM(require("graphql"), 1);
73690
73512
 
73691
73513
  // src/codegen/generators/definitions/enums.ts
73692
- var graphql23 = __toESM(require("graphql"), 1);
73514
+ var graphql22 = __toESM(require("graphql"), 1);
73693
73515
  var recast13 = __toESM(require_main2(), 1);
73694
73516
  var AST13 = recast13.types.builders;
73695
73517
  async function definitionsGenerator(config) {
73696
- const enums = graphql23.parse(graphql23.printSchema(config.schema)).definitions.filter(
73518
+ const enums = graphql22.parse(graphql22.printSchema(config.schema)).definitions.filter(
73697
73519
  (definition) => definition.kind === "EnumTypeDefinition"
73698
73520
  ).filter((def) => !config.isInternalEnum(def));
73699
73521
  const { code: runtimeDefinitions } = await printJS(
73700
73522
  AST13.program(
73701
73523
  enums.map((defn) => {
73702
73524
  const name = defn.name.value;
73703
- return moduleExport(
73525
+ const declaration = moduleExport(
73704
73526
  config,
73705
73527
  name,
73706
73528
  AST13.objectExpression(
73707
73529
  defn.values?.map((value) => {
73708
73530
  const str = value.name.value;
73709
- return AST13.objectProperty(
73531
+ const prop = AST13.objectProperty(
73710
73532
  AST13.stringLiteral(str),
73711
73533
  AST13.stringLiteral(str)
73712
73534
  );
73535
+ const deprecationReason = value.directives?.find((d3) => d3.name.value === "deprecated")?.arguments?.find((a2) => a2.name.value === "reason")?.value?.value;
73536
+ if (value.description || deprecationReason)
73537
+ prop.comments = [
73538
+ jsdocComment(value.description?.value ?? "", deprecationReason)
73539
+ ];
73540
+ return prop;
73713
73541
  }) || []
73714
73542
  )
73715
73543
  );
73544
+ if (defn.description) {
73545
+ declaration.comments = [
73546
+ AST13.commentBlock(`* ${defn.description.value} `, true, false)
73547
+ ];
73548
+ }
73549
+ return declaration;
73716
73550
  })
73717
73551
  )
73718
73552
  );
@@ -73721,11 +73555,19 @@ type ValuesOf<T> = T[keyof T]
73721
73555
  ` + enums.sort((a2, b2) => a2.name.value.localeCompare(b2.name.value)).map((definition) => {
73722
73556
  const name = definition.name.value;
73723
73557
  const values = definition.values;
73724
- return `
73558
+ let jsdoc = "";
73559
+ if (definition.description) {
73560
+ jsdoc = `
73561
+ /** ${definition.description.value} */`;
73562
+ }
73563
+ return `${jsdoc}
73725
73564
  export declare const ${name}: {
73726
- ${values?.map((value) => ` readonly ${value.name.value}: "${value.name.value}";`).join("\n")}
73565
+ ${values?.map(
73566
+ (value) => (value.description ? ` /** ${value.description.value} */
73567
+ ` : "") + ` readonly ${value.name.value}: "${value.name.value}";`
73568
+ ).join("\n")}
73727
73569
  }
73728
-
73570
+ ${jsdoc}
73729
73571
  export type ${name}$options = ValuesOf<typeof ${name}>
73730
73572
  `;
73731
73573
  }).join("");
@@ -73745,7 +73587,7 @@ async function schemaGenerator(config) {
73745
73587
  await Promise.all([
73746
73588
  fs_exports.writeFile(
73747
73589
  config.definitionsSchemaPath,
73748
- config.localSchema ? graphql24.printSchema(config.schema) : config.newSchema
73590
+ config.localSchema ? graphql23.printSchema(config.schema) : config.newSchema
73749
73591
  ),
73750
73592
  fs_exports.writeFile(config.definitionsDocumentsPath, config.newDocuments),
73751
73593
  definitionsGenerator(config)
@@ -73790,7 +73632,7 @@ async function writeIndexFile2(config, docs) {
73790
73632
  }
73791
73633
 
73792
73634
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/helpers.js
73793
- var import_graphql32 = require("graphql");
73635
+ var import_graphql33 = require("graphql");
73794
73636
  function compareStrings2(a2, b2) {
73795
73637
  if (String(a2) < String(b2)) {
73796
73638
  return -1;
@@ -73826,7 +73668,7 @@ function isSome2(input) {
73826
73668
  }
73827
73669
 
73828
73670
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/inspect.js
73829
- var import_graphql33 = require("graphql");
73671
+ var import_graphql34 = require("graphql");
73830
73672
  var MAX_RECURSIVE_DEPTH2 = 3;
73831
73673
  function inspect2(value) {
73832
73674
  return formatValue2(value, []);
@@ -73844,7 +73686,7 @@ function formatValue2(value, seenValues) {
73844
73686
  }
73845
73687
  }
73846
73688
  function formatError2(value) {
73847
- if (value instanceof import_graphql33.GraphQLError) {
73689
+ if (value instanceof import_graphql34.GraphQLError) {
73848
73690
  return value.toString();
73849
73691
  }
73850
73692
  return `${value.name}: ${value.message};
@@ -73927,43 +73769,43 @@ function getDirectivesInExtensions2(node, pathToDirectivesInExtensions = ["direc
73927
73769
  }
73928
73770
 
73929
73771
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js
73930
- var import_graphql37 = require("graphql");
73772
+ var import_graphql38 = require("graphql");
73931
73773
 
73932
73774
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromType.js
73933
- var import_graphql34 = require("graphql");
73775
+ var import_graphql35 = require("graphql");
73934
73776
  function astFromType2(type) {
73935
- if ((0, import_graphql34.isNonNullType)(type)) {
73777
+ if ((0, import_graphql35.isNonNullType)(type)) {
73936
73778
  const innerType = astFromType2(type.ofType);
73937
- if (innerType.kind === import_graphql34.Kind.NON_NULL_TYPE) {
73779
+ if (innerType.kind === import_graphql35.Kind.NON_NULL_TYPE) {
73938
73780
  throw new Error(`Invalid type node ${inspect2(type)}. Inner type of non-null type cannot be a non-null type.`);
73939
73781
  }
73940
73782
  return {
73941
- kind: import_graphql34.Kind.NON_NULL_TYPE,
73783
+ kind: import_graphql35.Kind.NON_NULL_TYPE,
73942
73784
  type: innerType
73943
73785
  };
73944
- } else if ((0, import_graphql34.isListType)(type)) {
73786
+ } else if ((0, import_graphql35.isListType)(type)) {
73945
73787
  return {
73946
- kind: import_graphql34.Kind.LIST_TYPE,
73788
+ kind: import_graphql35.Kind.LIST_TYPE,
73947
73789
  type: astFromType2(type.ofType)
73948
73790
  };
73949
73791
  }
73950
73792
  return {
73951
- kind: import_graphql34.Kind.NAMED_TYPE,
73793
+ kind: import_graphql35.Kind.NAMED_TYPE,
73952
73794
  name: {
73953
- kind: import_graphql34.Kind.NAME,
73795
+ kind: import_graphql35.Kind.NAME,
73954
73796
  value: type.name
73955
73797
  }
73956
73798
  };
73957
73799
  }
73958
73800
 
73959
73801
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
73960
- var import_graphql36 = require("graphql");
73802
+ var import_graphql37 = require("graphql");
73961
73803
 
73962
73804
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js
73963
- var import_graphql35 = require("graphql");
73805
+ var import_graphql36 = require("graphql");
73964
73806
  function astFromValueUntyped2(value) {
73965
73807
  if (value === null) {
73966
- return { kind: import_graphql35.Kind.NULL };
73808
+ return { kind: import_graphql36.Kind.NULL };
73967
73809
  }
73968
73810
  if (value === void 0) {
73969
73811
  return null;
@@ -73976,7 +73818,7 @@ function astFromValueUntyped2(value) {
73976
73818
  valuesNodes.push(itemNode);
73977
73819
  }
73978
73820
  }
73979
- return { kind: import_graphql35.Kind.LIST, values: valuesNodes };
73821
+ return { kind: import_graphql36.Kind.LIST, values: valuesNodes };
73980
73822
  }
73981
73823
  if (typeof value === "object") {
73982
73824
  const fieldNodes = [];
@@ -73985,26 +73827,26 @@ function astFromValueUntyped2(value) {
73985
73827
  const ast = astFromValueUntyped2(fieldValue);
73986
73828
  if (ast) {
73987
73829
  fieldNodes.push({
73988
- kind: import_graphql35.Kind.OBJECT_FIELD,
73989
- name: { kind: import_graphql35.Kind.NAME, value: fieldName },
73830
+ kind: import_graphql36.Kind.OBJECT_FIELD,
73831
+ name: { kind: import_graphql36.Kind.NAME, value: fieldName },
73990
73832
  value: ast
73991
73833
  });
73992
73834
  }
73993
73835
  }
73994
- return { kind: import_graphql35.Kind.OBJECT, fields: fieldNodes };
73836
+ return { kind: import_graphql36.Kind.OBJECT, fields: fieldNodes };
73995
73837
  }
73996
73838
  if (typeof value === "boolean") {
73997
- return { kind: import_graphql35.Kind.BOOLEAN, value };
73839
+ return { kind: import_graphql36.Kind.BOOLEAN, value };
73998
73840
  }
73999
73841
  if (typeof value === "bigint") {
74000
- return { kind: import_graphql35.Kind.INT, value: String(value) };
73842
+ return { kind: import_graphql36.Kind.INT, value: String(value) };
74001
73843
  }
74002
73844
  if (typeof value === "number" && isFinite(value)) {
74003
73845
  const stringNum = String(value);
74004
- return integerStringRegExp2.test(stringNum) ? { kind: import_graphql35.Kind.INT, value: stringNum } : { kind: import_graphql35.Kind.FLOAT, value: stringNum };
73846
+ return integerStringRegExp2.test(stringNum) ? { kind: import_graphql36.Kind.INT, value: stringNum } : { kind: import_graphql36.Kind.FLOAT, value: stringNum };
74005
73847
  }
74006
73848
  if (typeof value === "string") {
74007
- return { kind: import_graphql35.Kind.STRING, value };
73849
+ return { kind: import_graphql36.Kind.STRING, value };
74008
73850
  }
74009
73851
  throw new TypeError(`Cannot convert value to AST: ${value}.`);
74010
73852
  }
@@ -74012,20 +73854,20 @@ var integerStringRegExp2 = /^-?(?:0|[1-9][0-9]*)$/;
74012
73854
 
74013
73855
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
74014
73856
  function astFromValue2(value, type) {
74015
- if ((0, import_graphql36.isNonNullType)(type)) {
73857
+ if ((0, import_graphql37.isNonNullType)(type)) {
74016
73858
  const astValue = astFromValue2(value, type.ofType);
74017
- if (astValue?.kind === import_graphql36.Kind.NULL) {
73859
+ if (astValue?.kind === import_graphql37.Kind.NULL) {
74018
73860
  return null;
74019
73861
  }
74020
73862
  return astValue;
74021
73863
  }
74022
73864
  if (value === null) {
74023
- return { kind: import_graphql36.Kind.NULL };
73865
+ return { kind: import_graphql37.Kind.NULL };
74024
73866
  }
74025
73867
  if (value === void 0) {
74026
73868
  return null;
74027
73869
  }
74028
- if ((0, import_graphql36.isListType)(type)) {
73870
+ if ((0, import_graphql37.isListType)(type)) {
74029
73871
  const itemType = type.ofType;
74030
73872
  if (isIterableObject(value)) {
74031
73873
  const valuesNodes = [];
@@ -74035,11 +73877,11 @@ function astFromValue2(value, type) {
74035
73877
  valuesNodes.push(itemNode);
74036
73878
  }
74037
73879
  }
74038
- return { kind: import_graphql36.Kind.LIST, values: valuesNodes };
73880
+ return { kind: import_graphql37.Kind.LIST, values: valuesNodes };
74039
73881
  }
74040
73882
  return astFromValue2(value, itemType);
74041
73883
  }
74042
- if ((0, import_graphql36.isInputObjectType)(type)) {
73884
+ if ((0, import_graphql37.isInputObjectType)(type)) {
74043
73885
  if (!isObjectLike(value)) {
74044
73886
  return null;
74045
73887
  }
@@ -74048,24 +73890,24 @@ function astFromValue2(value, type) {
74048
73890
  const fieldValue = astFromValue2(value[field.name], field.type);
74049
73891
  if (fieldValue) {
74050
73892
  fieldNodes.push({
74051
- kind: import_graphql36.Kind.OBJECT_FIELD,
74052
- name: { kind: import_graphql36.Kind.NAME, value: field.name },
73893
+ kind: import_graphql37.Kind.OBJECT_FIELD,
73894
+ name: { kind: import_graphql37.Kind.NAME, value: field.name },
74053
73895
  value: fieldValue
74054
73896
  });
74055
73897
  }
74056
73898
  }
74057
- return { kind: import_graphql36.Kind.OBJECT, fields: fieldNodes };
73899
+ return { kind: import_graphql37.Kind.OBJECT, fields: fieldNodes };
74058
73900
  }
74059
- if ((0, import_graphql36.isLeafType)(type)) {
73901
+ if ((0, import_graphql37.isLeafType)(type)) {
74060
73902
  const serialized = type.serialize(value);
74061
73903
  if (serialized == null) {
74062
73904
  return null;
74063
73905
  }
74064
- if ((0, import_graphql36.isEnumType)(type)) {
74065
- return { kind: import_graphql36.Kind.ENUM, value: serialized };
73906
+ if ((0, import_graphql37.isEnumType)(type)) {
73907
+ return { kind: import_graphql37.Kind.ENUM, value: serialized };
74066
73908
  }
74067
73909
  if (type.name === "ID" && typeof serialized === "string" && integerStringRegExp3.test(serialized)) {
74068
- return { kind: import_graphql36.Kind.INT, value: serialized };
73910
+ return { kind: import_graphql37.Kind.INT, value: serialized };
74069
73911
  }
74070
73912
  return astFromValueUntyped2(serialized);
74071
73913
  }
@@ -74121,36 +73963,36 @@ function getDocumentNodeFromSchema2(schema, options = {}) {
74121
73963
  const definitions = schemaNode != null ? [schemaNode] : [];
74122
73964
  const directives = schema.getDirectives();
74123
73965
  for (const directive of directives) {
74124
- if ((0, import_graphql37.isSpecifiedDirective)(directive)) {
73966
+ if ((0, import_graphql38.isSpecifiedDirective)(directive)) {
74125
73967
  continue;
74126
73968
  }
74127
73969
  definitions.push(astFromDirective2(directive, schema, pathToDirectivesInExtensions));
74128
73970
  }
74129
73971
  for (const typeName in typesMap) {
74130
73972
  const type = typesMap[typeName];
74131
- const isPredefinedScalar = (0, import_graphql37.isSpecifiedScalarType)(type);
74132
- const isIntrospection = (0, import_graphql37.isIntrospectionType)(type);
73973
+ const isPredefinedScalar = (0, import_graphql38.isSpecifiedScalarType)(type);
73974
+ const isIntrospection = (0, import_graphql38.isIntrospectionType)(type);
74133
73975
  if (isPredefinedScalar || isIntrospection) {
74134
73976
  continue;
74135
73977
  }
74136
- if ((0, import_graphql37.isObjectType)(type)) {
73978
+ if ((0, import_graphql38.isObjectType)(type)) {
74137
73979
  definitions.push(astFromObjectType2(type, schema, pathToDirectivesInExtensions));
74138
- } else if ((0, import_graphql37.isInterfaceType)(type)) {
73980
+ } else if ((0, import_graphql38.isInterfaceType)(type)) {
74139
73981
  definitions.push(astFromInterfaceType2(type, schema, pathToDirectivesInExtensions));
74140
- } else if ((0, import_graphql37.isUnionType)(type)) {
73982
+ } else if ((0, import_graphql38.isUnionType)(type)) {
74141
73983
  definitions.push(astFromUnionType2(type, schema, pathToDirectivesInExtensions));
74142
- } else if ((0, import_graphql37.isInputObjectType)(type)) {
73984
+ } else if ((0, import_graphql38.isInputObjectType)(type)) {
74143
73985
  definitions.push(astFromInputObjectType2(type, schema, pathToDirectivesInExtensions));
74144
- } else if ((0, import_graphql37.isEnumType)(type)) {
73986
+ } else if ((0, import_graphql38.isEnumType)(type)) {
74145
73987
  definitions.push(astFromEnumType2(type, schema, pathToDirectivesInExtensions));
74146
- } else if ((0, import_graphql37.isScalarType)(type)) {
73988
+ } else if ((0, import_graphql38.isScalarType)(type)) {
74147
73989
  definitions.push(astFromScalarType2(type, schema, pathToDirectivesInExtensions));
74148
73990
  } else {
74149
73991
  throw new Error(`Unknown type ${type}.`);
74150
73992
  }
74151
73993
  }
74152
73994
  return {
74153
- kind: import_graphql37.Kind.DOCUMENT,
73995
+ kind: import_graphql38.Kind.DOCUMENT,
74154
73996
  definitions
74155
73997
  };
74156
73998
  }
@@ -74185,7 +74027,7 @@ function astFromSchema2(schema, pathToDirectivesInExtensions) {
74185
74027
  operationTypeDefinitionNode.type = rootTypeAST;
74186
74028
  } else {
74187
74029
  operationTypeMap.set(operationTypeNode, {
74188
- kind: import_graphql37.Kind.OPERATION_TYPE_DEFINITION,
74030
+ kind: import_graphql38.Kind.OPERATION_TYPE_DEFINITION,
74189
74031
  operation: operationTypeNode,
74190
74032
  type: rootTypeAST
74191
74033
  });
@@ -74198,12 +74040,12 @@ function astFromSchema2(schema, pathToDirectivesInExtensions) {
74198
74040
  return null;
74199
74041
  }
74200
74042
  const schemaNode = {
74201
- kind: operationTypes != null ? import_graphql37.Kind.SCHEMA_DEFINITION : import_graphql37.Kind.SCHEMA_EXTENSION,
74043
+ kind: operationTypes != null ? import_graphql38.Kind.SCHEMA_DEFINITION : import_graphql38.Kind.SCHEMA_EXTENSION,
74202
74044
  operationTypes,
74203
74045
  directives
74204
74046
  };
74205
74047
  schemaNode.description = schema.astNode?.description ?? schema.description != null ? {
74206
- kind: import_graphql37.Kind.STRING,
74048
+ kind: import_graphql38.Kind.STRING,
74207
74049
  value: schema.description,
74208
74050
  block: true
74209
74051
  } : void 0;
@@ -74211,19 +74053,19 @@ function astFromSchema2(schema, pathToDirectivesInExtensions) {
74211
74053
  }
74212
74054
  function astFromDirective2(directive, schema, pathToDirectivesInExtensions) {
74213
74055
  return {
74214
- kind: import_graphql37.Kind.DIRECTIVE_DEFINITION,
74056
+ kind: import_graphql38.Kind.DIRECTIVE_DEFINITION,
74215
74057
  description: directive.astNode?.description ?? (directive.description ? {
74216
- kind: import_graphql37.Kind.STRING,
74058
+ kind: import_graphql38.Kind.STRING,
74217
74059
  value: directive.description
74218
74060
  } : void 0),
74219
74061
  name: {
74220
- kind: import_graphql37.Kind.NAME,
74062
+ kind: import_graphql38.Kind.NAME,
74221
74063
  value: directive.name
74222
74064
  },
74223
74065
  arguments: directive.args?.map((arg) => astFromArg2(arg, schema, pathToDirectivesInExtensions)),
74224
74066
  repeatable: directive.isRepeatable,
74225
74067
  locations: directive.locations?.map((location) => ({
74226
- kind: import_graphql37.Kind.NAME,
74068
+ kind: import_graphql38.Kind.NAME,
74227
74069
  value: location
74228
74070
  })) || []
74229
74071
  };
@@ -74273,14 +74115,14 @@ function getDeprecatableDirectiveNodes2(entity, schema, pathToDirectivesInExtens
74273
74115
  }
74274
74116
  function astFromArg2(arg, schema, pathToDirectivesInExtensions) {
74275
74117
  return {
74276
- kind: import_graphql37.Kind.INPUT_VALUE_DEFINITION,
74118
+ kind: import_graphql38.Kind.INPUT_VALUE_DEFINITION,
74277
74119
  description: arg.astNode?.description ?? (arg.description ? {
74278
- kind: import_graphql37.Kind.STRING,
74120
+ kind: import_graphql38.Kind.STRING,
74279
74121
  value: arg.description,
74280
74122
  block: true
74281
74123
  } : void 0),
74282
74124
  name: {
74283
- kind: import_graphql37.Kind.NAME,
74125
+ kind: import_graphql38.Kind.NAME,
74284
74126
  value: arg.name
74285
74127
  },
74286
74128
  type: astFromType2(arg.type),
@@ -74290,14 +74132,14 @@ function astFromArg2(arg, schema, pathToDirectivesInExtensions) {
74290
74132
  }
74291
74133
  function astFromObjectType2(type, schema, pathToDirectivesInExtensions) {
74292
74134
  return {
74293
- kind: import_graphql37.Kind.OBJECT_TYPE_DEFINITION,
74135
+ kind: import_graphql38.Kind.OBJECT_TYPE_DEFINITION,
74294
74136
  description: type.astNode?.description ?? (type.description ? {
74295
- kind: import_graphql37.Kind.STRING,
74137
+ kind: import_graphql38.Kind.STRING,
74296
74138
  value: type.description,
74297
74139
  block: true
74298
74140
  } : void 0),
74299
74141
  name: {
74300
- kind: import_graphql37.Kind.NAME,
74142
+ kind: import_graphql38.Kind.NAME,
74301
74143
  value: type.name
74302
74144
  },
74303
74145
  fields: Object.values(type.getFields()).map((field) => astFromField2(field, schema, pathToDirectivesInExtensions)),
@@ -74307,14 +74149,14 @@ function astFromObjectType2(type, schema, pathToDirectivesInExtensions) {
74307
74149
  }
74308
74150
  function astFromInterfaceType2(type, schema, pathToDirectivesInExtensions) {
74309
74151
  const node = {
74310
- kind: import_graphql37.Kind.INTERFACE_TYPE_DEFINITION,
74152
+ kind: import_graphql38.Kind.INTERFACE_TYPE_DEFINITION,
74311
74153
  description: type.astNode?.description ?? (type.description ? {
74312
- kind: import_graphql37.Kind.STRING,
74154
+ kind: import_graphql38.Kind.STRING,
74313
74155
  value: type.description,
74314
74156
  block: true
74315
74157
  } : void 0),
74316
74158
  name: {
74317
- kind: import_graphql37.Kind.NAME,
74159
+ kind: import_graphql38.Kind.NAME,
74318
74160
  value: type.name
74319
74161
  },
74320
74162
  fields: Object.values(type.getFields()).map((field) => astFromField2(field, schema, pathToDirectivesInExtensions)),
@@ -74327,14 +74169,14 @@ function astFromInterfaceType2(type, schema, pathToDirectivesInExtensions) {
74327
74169
  }
74328
74170
  function astFromUnionType2(type, schema, pathToDirectivesInExtensions) {
74329
74171
  return {
74330
- kind: import_graphql37.Kind.UNION_TYPE_DEFINITION,
74172
+ kind: import_graphql38.Kind.UNION_TYPE_DEFINITION,
74331
74173
  description: type.astNode?.description ?? (type.description ? {
74332
- kind: import_graphql37.Kind.STRING,
74174
+ kind: import_graphql38.Kind.STRING,
74333
74175
  value: type.description,
74334
74176
  block: true
74335
74177
  } : void 0),
74336
74178
  name: {
74337
- kind: import_graphql37.Kind.NAME,
74179
+ kind: import_graphql38.Kind.NAME,
74338
74180
  value: type.name
74339
74181
  },
74340
74182
  directives: getDirectiveNodes2(type, schema, pathToDirectivesInExtensions),
@@ -74343,14 +74185,14 @@ function astFromUnionType2(type, schema, pathToDirectivesInExtensions) {
74343
74185
  }
74344
74186
  function astFromInputObjectType2(type, schema, pathToDirectivesInExtensions) {
74345
74187
  return {
74346
- kind: import_graphql37.Kind.INPUT_OBJECT_TYPE_DEFINITION,
74188
+ kind: import_graphql38.Kind.INPUT_OBJECT_TYPE_DEFINITION,
74347
74189
  description: type.astNode?.description ?? (type.description ? {
74348
- kind: import_graphql37.Kind.STRING,
74190
+ kind: import_graphql38.Kind.STRING,
74349
74191
  value: type.description,
74350
74192
  block: true
74351
74193
  } : void 0),
74352
74194
  name: {
74353
- kind: import_graphql37.Kind.NAME,
74195
+ kind: import_graphql38.Kind.NAME,
74354
74196
  value: type.name
74355
74197
  },
74356
74198
  fields: Object.values(type.getFields()).map((field) => astFromInputField2(field, schema, pathToDirectivesInExtensions)),
@@ -74359,14 +74201,14 @@ function astFromInputObjectType2(type, schema, pathToDirectivesInExtensions) {
74359
74201
  }
74360
74202
  function astFromEnumType2(type, schema, pathToDirectivesInExtensions) {
74361
74203
  return {
74362
- kind: import_graphql37.Kind.ENUM_TYPE_DEFINITION,
74204
+ kind: import_graphql38.Kind.ENUM_TYPE_DEFINITION,
74363
74205
  description: type.astNode?.description ?? (type.description ? {
74364
- kind: import_graphql37.Kind.STRING,
74206
+ kind: import_graphql38.Kind.STRING,
74365
74207
  value: type.description,
74366
74208
  block: true
74367
74209
  } : void 0),
74368
74210
  name: {
74369
- kind: import_graphql37.Kind.NAME,
74211
+ kind: import_graphql38.Kind.NAME,
74370
74212
  value: type.name
74371
74213
  },
74372
74214
  values: Object.values(type.getValues()).map((value) => astFromEnumValue2(value, schema, pathToDirectivesInExtensions)),
@@ -74384,14 +74226,14 @@ function astFromScalarType2(type, schema, pathToDirectivesInExtensions) {
74384
74226
  directives.push(makeDirectiveNode2("specifiedBy", specifiedByArgs));
74385
74227
  }
74386
74228
  return {
74387
- kind: import_graphql37.Kind.SCALAR_TYPE_DEFINITION,
74229
+ kind: import_graphql38.Kind.SCALAR_TYPE_DEFINITION,
74388
74230
  description: type.astNode?.description ?? (type.description ? {
74389
- kind: import_graphql37.Kind.STRING,
74231
+ kind: import_graphql38.Kind.STRING,
74390
74232
  value: type.description,
74391
74233
  block: true
74392
74234
  } : void 0),
74393
74235
  name: {
74394
- kind: import_graphql37.Kind.NAME,
74236
+ kind: import_graphql38.Kind.NAME,
74395
74237
  value: type.name
74396
74238
  },
74397
74239
  directives
@@ -74399,14 +74241,14 @@ function astFromScalarType2(type, schema, pathToDirectivesInExtensions) {
74399
74241
  }
74400
74242
  function astFromField2(field, schema, pathToDirectivesInExtensions) {
74401
74243
  return {
74402
- kind: import_graphql37.Kind.FIELD_DEFINITION,
74244
+ kind: import_graphql38.Kind.FIELD_DEFINITION,
74403
74245
  description: field.astNode?.description ?? (field.description ? {
74404
- kind: import_graphql37.Kind.STRING,
74246
+ kind: import_graphql38.Kind.STRING,
74405
74247
  value: field.description,
74406
74248
  block: true
74407
74249
  } : void 0),
74408
74250
  name: {
74409
- kind: import_graphql37.Kind.NAME,
74251
+ kind: import_graphql38.Kind.NAME,
74410
74252
  value: field.name
74411
74253
  },
74412
74254
  arguments: field.args.map((arg) => astFromArg2(arg, schema, pathToDirectivesInExtensions)),
@@ -74416,14 +74258,14 @@ function astFromField2(field, schema, pathToDirectivesInExtensions) {
74416
74258
  }
74417
74259
  function astFromInputField2(field, schema, pathToDirectivesInExtensions) {
74418
74260
  return {
74419
- kind: import_graphql37.Kind.INPUT_VALUE_DEFINITION,
74261
+ kind: import_graphql38.Kind.INPUT_VALUE_DEFINITION,
74420
74262
  description: field.astNode?.description ?? (field.description ? {
74421
- kind: import_graphql37.Kind.STRING,
74263
+ kind: import_graphql38.Kind.STRING,
74422
74264
  value: field.description,
74423
74265
  block: true
74424
74266
  } : void 0),
74425
74267
  name: {
74426
- kind: import_graphql37.Kind.NAME,
74268
+ kind: import_graphql38.Kind.NAME,
74427
74269
  value: field.name
74428
74270
  },
74429
74271
  type: astFromType2(field.type),
@@ -74433,21 +74275,21 @@ function astFromInputField2(field, schema, pathToDirectivesInExtensions) {
74433
74275
  }
74434
74276
  function astFromEnumValue2(value, schema, pathToDirectivesInExtensions) {
74435
74277
  return {
74436
- kind: import_graphql37.Kind.ENUM_VALUE_DEFINITION,
74278
+ kind: import_graphql38.Kind.ENUM_VALUE_DEFINITION,
74437
74279
  description: value.astNode?.description ?? (value.description ? {
74438
- kind: import_graphql37.Kind.STRING,
74280
+ kind: import_graphql38.Kind.STRING,
74439
74281
  value: value.description,
74440
74282
  block: true
74441
74283
  } : void 0),
74442
74284
  name: {
74443
- kind: import_graphql37.Kind.NAME,
74285
+ kind: import_graphql38.Kind.NAME,
74444
74286
  value: value.name
74445
74287
  },
74446
74288
  directives: getDeprecatableDirectiveNodes2(value, schema, pathToDirectivesInExtensions)
74447
74289
  };
74448
74290
  }
74449
74291
  function makeDeprecatedDirective2(deprecationReason) {
74450
- return makeDirectiveNode2("deprecated", { reason: deprecationReason }, import_graphql37.GraphQLDeprecatedDirective);
74292
+ return makeDirectiveNode2("deprecated", { reason: deprecationReason }, import_graphql38.GraphQLDeprecatedDirective);
74451
74293
  }
74452
74294
  function makeDirectiveNode2(name, args, directive) {
74453
74295
  const directiveArguments = [];
@@ -74459,9 +74301,9 @@ function makeDirectiveNode2(name, args, directive) {
74459
74301
  const value = astFromValue2(argValue, arg.type);
74460
74302
  if (value) {
74461
74303
  directiveArguments.push({
74462
- kind: import_graphql37.Kind.ARGUMENT,
74304
+ kind: import_graphql38.Kind.ARGUMENT,
74463
74305
  name: {
74464
- kind: import_graphql37.Kind.NAME,
74306
+ kind: import_graphql38.Kind.NAME,
74465
74307
  value: argName
74466
74308
  },
74467
74309
  value
@@ -74475,9 +74317,9 @@ function makeDirectiveNode2(name, args, directive) {
74475
74317
  const value = astFromValueUntyped2(argValue);
74476
74318
  if (value) {
74477
74319
  directiveArguments.push({
74478
- kind: import_graphql37.Kind.ARGUMENT,
74320
+ kind: import_graphql38.Kind.ARGUMENT,
74479
74321
  name: {
74480
- kind: import_graphql37.Kind.NAME,
74322
+ kind: import_graphql38.Kind.NAME,
74481
74323
  value: argName
74482
74324
  },
74483
74325
  value
@@ -74486,9 +74328,9 @@ function makeDirectiveNode2(name, args, directive) {
74486
74328
  }
74487
74329
  }
74488
74330
  return {
74489
- kind: import_graphql37.Kind.DIRECTIVE,
74331
+ kind: import_graphql38.Kind.DIRECTIVE,
74490
74332
  name: {
74491
- kind: import_graphql37.Kind.NAME,
74333
+ kind: import_graphql38.Kind.NAME,
74492
74334
  value: name
74493
74335
  },
74494
74336
  arguments: directiveArguments
@@ -74511,7 +74353,7 @@ function makeDirectiveNodes2(schema, directiveValues) {
74511
74353
  }
74512
74354
 
74513
74355
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/comments.js
74514
- var import_graphql38 = require("graphql");
74356
+ var import_graphql39 = require("graphql");
74515
74357
  var MAX_LINE_LENGTH2 = 80;
74516
74358
  var commentsRegistry2 = {};
74517
74359
  function resetComments2() {
@@ -74756,7 +74598,7 @@ var printDocASTReducerWithComments2 = Object.keys(printDocASTReducer2).reduce((p
74756
74598
  }
74757
74599
  }), {});
74758
74600
  function printWithComments2(ast) {
74759
- return (0, import_graphql38.visit)(ast, printDocASTReducerWithComments2);
74601
+ return (0, import_graphql39.visit)(ast, printDocASTReducerWithComments2);
74760
74602
  }
74761
74603
  function isFieldDefinitionNode2(node) {
74762
74604
  return node.kind === "FieldDefinition";
@@ -74775,7 +74617,7 @@ function getLeadingCommentBlock2(node) {
74775
74617
  }
74776
74618
  const comments = [];
74777
74619
  let token = loc.startToken.prev;
74778
- while (token != null && token.kind === import_graphql38.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
74620
+ while (token != null && token.kind === import_graphql39.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
74779
74621
  const value = String(token.value);
74780
74622
  comments.push(value);
74781
74623
  token = token.prev;
@@ -74827,9 +74669,9 @@ function isBlank2(str) {
74827
74669
  }
74828
74670
 
74829
74671
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/isDocumentNode.js
74830
- var import_graphql39 = require("graphql");
74672
+ var import_graphql40 = require("graphql");
74831
74673
  function isDocumentNode2(object) {
74832
- return object && typeof object === "object" && "kind" in object && object.kind === import_graphql39.Kind.DOCUMENT;
74674
+ return object && typeof object === "object" && "kind" in object && object.kind === import_graphql40.Kind.DOCUMENT;
74833
74675
  }
74834
74676
 
74835
74677
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js
@@ -74853,7 +74695,7 @@ function deduplicateArguments2(args, config) {
74853
74695
  }
74854
74696
 
74855
74697
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js
74856
- var import_graphql40 = require("graphql");
74698
+ var import_graphql41 = require("graphql");
74857
74699
  function directiveAlreadyExists2(directivesArr, otherDirective) {
74858
74700
  return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
74859
74701
  }
@@ -74913,11 +74755,11 @@ function mergeDirectives2(d1 = [], d22 = [], config, directives) {
74913
74755
  return result;
74914
74756
  }
74915
74757
  function validateInputs2(node, existingNode) {
74916
- const printedNode = (0, import_graphql40.print)({
74758
+ const printedNode = (0, import_graphql41.print)({
74917
74759
  ...node,
74918
74760
  description: void 0
74919
74761
  });
74920
- const printedExistingNode = (0, import_graphql40.print)({
74762
+ const printedExistingNode = (0, import_graphql41.print)({
74921
74763
  ...existingNode,
74922
74764
  description: void 0
74923
74765
  });
@@ -74984,7 +74826,7 @@ function mergeEnumValues2(first, second, config, directives) {
74984
74826
  }
74985
74827
 
74986
74828
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js
74987
- var import_graphql41 = require("graphql");
74829
+ var import_graphql42 = require("graphql");
74988
74830
  function mergeEnum2(e1, e22, config, directives) {
74989
74831
  if (e22) {
74990
74832
  return {
@@ -74998,33 +74840,33 @@ function mergeEnum2(e1, e22, config, directives) {
74998
74840
  }
74999
74841
  return config?.convertExtensions ? {
75000
74842
  ...e1,
75001
- kind: import_graphql41.Kind.ENUM_TYPE_DEFINITION
74843
+ kind: import_graphql42.Kind.ENUM_TYPE_DEFINITION
75002
74844
  } : e1;
75003
74845
  }
75004
74846
 
75005
74847
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
75006
- var import_graphql42 = require("graphql");
74848
+ var import_graphql43 = require("graphql");
75007
74849
  function isStringTypes2(types16) {
75008
74850
  return typeof types16 === "string";
75009
74851
  }
75010
74852
  function isSourceTypes2(types16) {
75011
- return types16 instanceof import_graphql42.Source;
74853
+ return types16 instanceof import_graphql43.Source;
75012
74854
  }
75013
74855
  function extractType2(type) {
75014
74856
  let visitedType = type;
75015
- while (visitedType.kind === import_graphql42.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
74857
+ while (visitedType.kind === import_graphql43.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
75016
74858
  visitedType = visitedType.type;
75017
74859
  }
75018
74860
  return visitedType;
75019
74861
  }
75020
74862
  function isWrappingTypeNode2(type) {
75021
- return type.kind !== import_graphql42.Kind.NAMED_TYPE;
74863
+ return type.kind !== import_graphql43.Kind.NAMED_TYPE;
75022
74864
  }
75023
74865
  function isListTypeNode2(type) {
75024
- return type.kind === import_graphql42.Kind.LIST_TYPE;
74866
+ return type.kind === import_graphql43.Kind.LIST_TYPE;
75025
74867
  }
75026
74868
  function isNonNullTypeNode2(type) {
75027
- return type.kind === import_graphql42.Kind.NON_NULL_TYPE;
74869
+ return type.kind === import_graphql43.Kind.NON_NULL_TYPE;
75028
74870
  }
75029
74871
  function printTypeNode2(type) {
75030
74872
  if (isListTypeNode2(type)) {
@@ -75127,7 +74969,7 @@ function safeChangeForFieldType2(oldType, newType, ignoreNullability = false) {
75127
74969
  }
75128
74970
 
75129
74971
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js
75130
- var import_graphql43 = require("graphql");
74972
+ var import_graphql44 = require("graphql");
75131
74973
  function mergeInputType2(node, existingNode, config, directives) {
75132
74974
  if (existingNode) {
75133
74975
  try {
@@ -75145,12 +74987,12 @@ function mergeInputType2(node, existingNode, config, directives) {
75145
74987
  }
75146
74988
  return config?.convertExtensions ? {
75147
74989
  ...node,
75148
- kind: import_graphql43.Kind.INPUT_OBJECT_TYPE_DEFINITION
74990
+ kind: import_graphql44.Kind.INPUT_OBJECT_TYPE_DEFINITION
75149
74991
  } : node;
75150
74992
  }
75151
74993
 
75152
74994
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js
75153
- var import_graphql44 = require("graphql");
74995
+ var import_graphql45 = require("graphql");
75154
74996
 
75155
74997
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js
75156
74998
  function alreadyExists2(arr, other) {
@@ -75183,15 +75025,15 @@ function mergeInterface2(node, existingNode, config, directives) {
75183
75025
  }
75184
75026
  return config?.convertExtensions ? {
75185
75027
  ...node,
75186
- kind: import_graphql44.Kind.INTERFACE_TYPE_DEFINITION
75028
+ kind: import_graphql45.Kind.INTERFACE_TYPE_DEFINITION
75187
75029
  } : node;
75188
75030
  }
75189
75031
 
75190
75032
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js
75191
- var import_graphql49 = require("graphql");
75033
+ var import_graphql50 = require("graphql");
75192
75034
 
75193
75035
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js
75194
- var import_graphql45 = require("graphql");
75036
+ var import_graphql46 = require("graphql");
75195
75037
  function mergeType2(node, existingNode, config, directives) {
75196
75038
  if (existingNode) {
75197
75039
  try {
@@ -75210,12 +75052,12 @@ function mergeType2(node, existingNode, config, directives) {
75210
75052
  }
75211
75053
  return config?.convertExtensions ? {
75212
75054
  ...node,
75213
- kind: import_graphql45.Kind.OBJECT_TYPE_DEFINITION
75055
+ kind: import_graphql46.Kind.OBJECT_TYPE_DEFINITION
75214
75056
  } : node;
75215
75057
  }
75216
75058
 
75217
75059
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js
75218
- var import_graphql46 = require("graphql");
75060
+ var import_graphql47 = require("graphql");
75219
75061
  function mergeScalar2(node, existingNode, config, directives) {
75220
75062
  if (existingNode) {
75221
75063
  return {
@@ -75228,31 +75070,31 @@ function mergeScalar2(node, existingNode, config, directives) {
75228
75070
  }
75229
75071
  return config?.convertExtensions ? {
75230
75072
  ...node,
75231
- kind: import_graphql46.Kind.SCALAR_TYPE_DEFINITION
75073
+ kind: import_graphql47.Kind.SCALAR_TYPE_DEFINITION
75232
75074
  } : node;
75233
75075
  }
75234
75076
 
75235
75077
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js
75236
- var import_graphql47 = require("graphql");
75078
+ var import_graphql48 = require("graphql");
75237
75079
  function mergeUnion2(first, second, config, directives) {
75238
75080
  if (second) {
75239
75081
  return {
75240
75082
  name: first.name,
75241
75083
  description: first["description"] || second["description"],
75242
75084
  directives: mergeDirectives2(first.directives, second.directives, config, directives),
75243
- kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql47.Kind.UNION_TYPE_DEFINITION : import_graphql47.Kind.UNION_TYPE_EXTENSION,
75085
+ kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql48.Kind.UNION_TYPE_DEFINITION : import_graphql48.Kind.UNION_TYPE_EXTENSION,
75244
75086
  loc: first.loc,
75245
75087
  types: mergeNamedTypeArray2(first.types, second.types, config)
75246
75088
  };
75247
75089
  }
75248
75090
  return config?.convertExtensions ? {
75249
75091
  ...first,
75250
- kind: import_graphql47.Kind.UNION_TYPE_DEFINITION
75092
+ kind: import_graphql48.Kind.UNION_TYPE_DEFINITION
75251
75093
  } : first;
75252
75094
  }
75253
75095
 
75254
75096
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js
75255
- var import_graphql48 = require("graphql");
75097
+ var import_graphql49 = require("graphql");
75256
75098
  var DEFAULT_OPERATION_TYPE_NAME_MAP2 = {
75257
75099
  query: "Query",
75258
75100
  mutation: "Mutation",
@@ -75271,7 +75113,7 @@ function mergeOperationTypes2(opNodeList = [], existingOpNodeList = []) {
75271
75113
  function mergeSchemaDefs2(node, existingNode, config, directives) {
75272
75114
  if (existingNode) {
75273
75115
  return {
75274
- kind: node.kind === import_graphql48.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql48.Kind.SCHEMA_DEFINITION ? import_graphql48.Kind.SCHEMA_DEFINITION : import_graphql48.Kind.SCHEMA_EXTENSION,
75116
+ kind: node.kind === import_graphql49.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql49.Kind.SCHEMA_DEFINITION ? import_graphql49.Kind.SCHEMA_DEFINITION : import_graphql49.Kind.SCHEMA_EXTENSION,
75275
75117
  description: node["description"] || existingNode["description"],
75276
75118
  directives: mergeDirectives2(node.directives, existingNode.directives, config, directives),
75277
75119
  operationTypes: mergeOperationTypes2(node.operationTypes, existingNode.operationTypes)
@@ -75279,7 +75121,7 @@ function mergeSchemaDefs2(node, existingNode, config, directives) {
75279
75121
  }
75280
75122
  return config?.convertExtensions ? {
75281
75123
  ...node,
75282
- kind: import_graphql48.Kind.SCHEMA_DEFINITION
75124
+ kind: import_graphql49.Kind.SCHEMA_DEFINITION
75283
75125
  } : node;
75284
75126
  }
75285
75127
 
@@ -75303,36 +75145,36 @@ function mergeGraphQLNodes2(nodes, config, directives = {}) {
75303
75145
  delete mergedResultMap[name];
75304
75146
  } else {
75305
75147
  switch (nodeDefinition.kind) {
75306
- case import_graphql49.Kind.OBJECT_TYPE_DEFINITION:
75307
- case import_graphql49.Kind.OBJECT_TYPE_EXTENSION:
75148
+ case import_graphql50.Kind.OBJECT_TYPE_DEFINITION:
75149
+ case import_graphql50.Kind.OBJECT_TYPE_EXTENSION:
75308
75150
  mergedResultMap[name] = mergeType2(nodeDefinition, mergedResultMap[name], config, directives);
75309
75151
  break;
75310
- case import_graphql49.Kind.ENUM_TYPE_DEFINITION:
75311
- case import_graphql49.Kind.ENUM_TYPE_EXTENSION:
75152
+ case import_graphql50.Kind.ENUM_TYPE_DEFINITION:
75153
+ case import_graphql50.Kind.ENUM_TYPE_EXTENSION:
75312
75154
  mergedResultMap[name] = mergeEnum2(nodeDefinition, mergedResultMap[name], config, directives);
75313
75155
  break;
75314
- case import_graphql49.Kind.UNION_TYPE_DEFINITION:
75315
- case import_graphql49.Kind.UNION_TYPE_EXTENSION:
75156
+ case import_graphql50.Kind.UNION_TYPE_DEFINITION:
75157
+ case import_graphql50.Kind.UNION_TYPE_EXTENSION:
75316
75158
  mergedResultMap[name] = mergeUnion2(nodeDefinition, mergedResultMap[name], config, directives);
75317
75159
  break;
75318
- case import_graphql49.Kind.SCALAR_TYPE_DEFINITION:
75319
- case import_graphql49.Kind.SCALAR_TYPE_EXTENSION:
75160
+ case import_graphql50.Kind.SCALAR_TYPE_DEFINITION:
75161
+ case import_graphql50.Kind.SCALAR_TYPE_EXTENSION:
75320
75162
  mergedResultMap[name] = mergeScalar2(nodeDefinition, mergedResultMap[name], config, directives);
75321
75163
  break;
75322
- case import_graphql49.Kind.INPUT_OBJECT_TYPE_DEFINITION:
75323
- case import_graphql49.Kind.INPUT_OBJECT_TYPE_EXTENSION:
75164
+ case import_graphql50.Kind.INPUT_OBJECT_TYPE_DEFINITION:
75165
+ case import_graphql50.Kind.INPUT_OBJECT_TYPE_EXTENSION:
75324
75166
  mergedResultMap[name] = mergeInputType2(nodeDefinition, mergedResultMap[name], config, directives);
75325
75167
  break;
75326
- case import_graphql49.Kind.INTERFACE_TYPE_DEFINITION:
75327
- case import_graphql49.Kind.INTERFACE_TYPE_EXTENSION:
75168
+ case import_graphql50.Kind.INTERFACE_TYPE_DEFINITION:
75169
+ case import_graphql50.Kind.INTERFACE_TYPE_EXTENSION:
75328
75170
  mergedResultMap[name] = mergeInterface2(nodeDefinition, mergedResultMap[name], config, directives);
75329
75171
  break;
75330
- case import_graphql49.Kind.DIRECTIVE_DEFINITION:
75172
+ case import_graphql50.Kind.DIRECTIVE_DEFINITION:
75331
75173
  mergedResultMap[name] = mergeDirective2(nodeDefinition, mergedResultMap[name]);
75332
75174
  break;
75333
75175
  }
75334
75176
  }
75335
- } else if (nodeDefinition.kind === import_graphql49.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql49.Kind.SCHEMA_EXTENSION) {
75177
+ } else if (nodeDefinition.kind === import_graphql50.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql50.Kind.SCHEMA_EXTENSION) {
75336
75178
  mergedResultMap[schemaDefSymbol2] = mergeSchemaDefs2(nodeDefinition, mergedResultMap[schemaDefSymbol2], config);
75337
75179
  }
75338
75180
  }
@@ -75340,11 +75182,11 @@ function mergeGraphQLNodes2(nodes, config, directives = {}) {
75340
75182
  }
75341
75183
 
75342
75184
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js
75343
- var import_graphql50 = require("graphql");
75185
+ var import_graphql51 = require("graphql");
75344
75186
  function mergeTypeDefs2(typeSource, config) {
75345
75187
  resetComments2();
75346
75188
  const doc = {
75347
- kind: import_graphql50.Kind.DOCUMENT,
75189
+ kind: import_graphql51.Kind.DOCUMENT,
75348
75190
  definitions: mergeGraphQLTypes2(typeSource, {
75349
75191
  useSchemaDefinition: true,
75350
75192
  forceSchemaDefinition: false,
@@ -75371,14 +75213,14 @@ function visitTypeSources2(typeSource, options, allDirectives = [], allNodes = [
75371
75213
  for (const type of typeSource) {
75372
75214
  visitTypeSources2(type, options, allDirectives, allNodes, visitedTypeSources);
75373
75215
  }
75374
- } else if ((0, import_graphql50.isSchema)(typeSource)) {
75216
+ } else if ((0, import_graphql51.isSchema)(typeSource)) {
75375
75217
  const documentNode = getDocumentNodeFromSchema2(typeSource, options);
75376
75218
  visitTypeSources2(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
75377
75219
  } else if (isStringTypes2(typeSource) || isSourceTypes2(typeSource)) {
75378
- const documentNode = (0, import_graphql50.parse)(typeSource, options);
75220
+ const documentNode = (0, import_graphql51.parse)(typeSource, options);
75379
75221
  visitTypeSources2(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
75380
- } else if (typeof typeSource === "object" && (0, import_graphql50.isDefinitionNode)(typeSource)) {
75381
- if (typeSource.kind === import_graphql50.Kind.DIRECTIVE_DEFINITION) {
75222
+ } else if (typeof typeSource === "object" && (0, import_graphql51.isDefinitionNode)(typeSource)) {
75223
+ if (typeSource.kind === import_graphql51.Kind.DIRECTIVE_DEFINITION) {
75382
75224
  allDirectives.push(typeSource);
75383
75225
  } else {
75384
75226
  allNodes.push(typeSource);
@@ -75398,7 +75240,7 @@ function mergeGraphQLTypes2(typeSource, config) {
75398
75240
  const mergedNodes = mergeGraphQLNodes2(allNodes, config, mergedDirectives);
75399
75241
  if (config?.useSchemaDefinition) {
75400
75242
  const schemaDef = mergedNodes[schemaDefSymbol2] || {
75401
- kind: import_graphql50.Kind.SCHEMA_DEFINITION,
75243
+ kind: import_graphql51.Kind.SCHEMA_DEFINITION,
75402
75244
  operationTypes: []
75403
75245
  };
75404
75246
  const operationTypes = schemaDef.operationTypes;
@@ -75409,9 +75251,9 @@ function mergeGraphQLTypes2(typeSource, config) {
75409
75251
  const existingPossibleRootType = mergedNodes[possibleRootTypeName];
75410
75252
  if (existingPossibleRootType != null && existingPossibleRootType.name != null) {
75411
75253
  operationTypes.push({
75412
- kind: import_graphql50.Kind.OPERATION_TYPE_DEFINITION,
75254
+ kind: import_graphql51.Kind.OPERATION_TYPE_DEFINITION,
75413
75255
  type: {
75414
- kind: import_graphql50.Kind.NAMED_TYPE,
75256
+ kind: import_graphql51.Kind.NAMED_TYPE,
75415
75257
  name: existingPossibleRootType.name
75416
75258
  },
75417
75259
  operation: opTypeDefNodeType
@@ -75425,15 +75267,15 @@ function mergeGraphQLTypes2(typeSource, config) {
75425
75267
  }
75426
75268
  if (config?.forceSchemaDefinition && !mergedNodes[schemaDefSymbol2]?.operationTypes?.length) {
75427
75269
  mergedNodes[schemaDefSymbol2] = {
75428
- kind: import_graphql50.Kind.SCHEMA_DEFINITION,
75270
+ kind: import_graphql51.Kind.SCHEMA_DEFINITION,
75429
75271
  operationTypes: [
75430
75272
  {
75431
- kind: import_graphql50.Kind.OPERATION_TYPE_DEFINITION,
75273
+ kind: import_graphql51.Kind.OPERATION_TYPE_DEFINITION,
75432
75274
  operation: "query",
75433
75275
  type: {
75434
- kind: import_graphql50.Kind.NAMED_TYPE,
75276
+ kind: import_graphql51.Kind.NAMED_TYPE,
75435
75277
  name: {
75436
- kind: import_graphql50.Kind.NAME,
75278
+ kind: import_graphql51.Kind.NAME,
75437
75279
  value: "Query"
75438
75280
  }
75439
75281
  }
@@ -75450,7 +75292,7 @@ function mergeGraphQLTypes2(typeSource, config) {
75450
75292
  }
75451
75293
 
75452
75294
  // src/codegen/transforms/schema.ts
75453
- var graphql25 = __toESM(require("graphql"), 1);
75295
+ var graphql24 = __toESM(require("graphql"), 1);
75454
75296
  async function graphqlExtensions(config, documents) {
75455
75297
  let internalSchema = `
75456
75298
  enum CachePolicy {
@@ -75554,7 +75396,7 @@ ${config.configFile.features?.componentFields ? `
75554
75396
  """
75555
75397
  @${config.componentFieldDirective} marks an inline fragment as the selection for a component field
75556
75398
  """
75557
- directive @${config.componentFieldDirective}(field: String!, prop: String, export: String, raw: String) on FRAGMENT_DEFINITION | INLINE_FRAGMENT
75399
+ directive @${config.componentFieldDirective}(field: String!, prop: String, export: String, raw: String) on FRAGMENT_DEFINITION | INLINE_FRAGMENT | FIELD_DEFINITION
75558
75400
 
75559
75401
  ` : ""}
75560
75402
 
@@ -75565,7 +75407,7 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
75565
75407
  }
75566
75408
  internalSchema += plugin2.schema({ config });
75567
75409
  }
75568
- const extensions = Object.entries(config.componentFields).map(([parent2, fields]) => {
75410
+ let extensions = Object.entries(config.componentFields).map(([parent2, fields]) => {
75569
75411
  return `
75570
75412
  extend type ${parent2} {
75571
75413
  ${Object.entries(fields).map(([fieldName, field]) => {
@@ -75573,29 +75415,30 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
75573
75415
  const args = fragmentArguments(config, "", field.parent);
75574
75416
  if (args.length > 0) {
75575
75417
  argString = "(" + args.map((arg) => {
75576
- const typeName = graphql25.print(arg.type);
75418
+ const typeName = graphql24.print(arg.type);
75577
75419
  return `${arg.name}:${typeName}${arg.required ? "!" : ""}`;
75578
75420
  }).join("\n") + ")";
75579
75421
  }
75580
- return `${fieldName}${argString}: ${config.componentScalar}!`;
75422
+ return `${fieldName}${argString}: ${config.componentScalar}! @componentField(field: "${fieldName}")`;
75581
75423
  }).join("\n")}
75582
75424
  }
75583
75425
  `;
75584
75426
  }).join("\n");
75585
- config.newSchema = graphql25.print(mergeTypeDefs2([internalSchema, config.newSchema]));
75427
+ extensions += `${Object.keys(config.configFile.features?.runtimeScalars ?? {}).map((scalar) => `scalar ${scalar}`).join("\n")}`;
75428
+ config.newSchema = graphql24.print(mergeTypeDefs2([internalSchema, config.newSchema]));
75586
75429
  config.schemaString += extensions;
75587
- config.schema = graphql25.buildSchema(
75588
- graphql25.print(
75589
- mergeTypeDefs2([graphql25.printSchema(config.schema), internalSchema, extensions])
75430
+ config.schema = graphql24.buildSchema(
75431
+ graphql24.print(
75432
+ mergeTypeDefs2([graphql24.printSchema(config.schema), internalSchema, extensions])
75590
75433
  )
75591
75434
  );
75592
75435
  }
75593
75436
 
75594
75437
  // src/codegen/transforms/typename.ts
75595
- var graphql26 = __toESM(require("graphql"), 1);
75438
+ var graphql25 = __toESM(require("graphql"), 1);
75596
75439
  async function addTypename(config, documents) {
75597
75440
  for (const doc of documents) {
75598
- doc.document = graphql26.visit(doc.document, {
75441
+ doc.document = graphql25.visit(doc.document, {
75599
75442
  Field(node, key, parent2, path3, ancestors) {
75600
75443
  if (!node.selectionSet) {
75601
75444
  return;
@@ -75607,7 +75450,7 @@ async function addTypename(config, documents) {
75607
75450
  );
75608
75451
  const field = type.getFields()[node.name.value];
75609
75452
  const fieldType = unwrapType(config, field.type).type;
75610
- if (graphql26.isInterfaceType(fieldType) || graphql26.isUnionType(fieldType)) {
75453
+ if (graphql25.isInterfaceType(fieldType) || graphql25.isUnionType(fieldType)) {
75611
75454
  return {
75612
75455
  ...node,
75613
75456
  selectionSet: {
@@ -75615,9 +75458,9 @@ async function addTypename(config, documents) {
75615
75458
  selections: [
75616
75459
  ...node.selectionSet.selections,
75617
75460
  {
75618
- kind: graphql26.Kind.FIELD,
75461
+ kind: graphql25.Kind.FIELD,
75619
75462
  name: {
75620
- kind: graphql26.Kind.NAME,
75463
+ kind: graphql25.Kind.NAME,
75621
75464
  value: "__typename"
75622
75465
  }
75623
75466
  }
@@ -75634,9 +75477,9 @@ async function addTypename(config, documents) {
75634
75477
  selections: [
75635
75478
  ...node.selectionSet.selections,
75636
75479
  {
75637
- kind: graphql26.Kind.FIELD,
75480
+ kind: graphql25.Kind.FIELD,
75638
75481
  name: {
75639
- kind: graphql26.Kind.NAME,
75482
+ kind: graphql25.Kind.NAME,
75640
75483
  value: "__typename"
75641
75484
  }
75642
75485
  }
@@ -75649,10 +75492,10 @@ async function addTypename(config, documents) {
75649
75492
  }
75650
75493
 
75651
75494
  // src/codegen/transforms/addID.ts
75652
- var graphql27 = __toESM(require("graphql"), 1);
75495
+ var graphql26 = __toESM(require("graphql"), 1);
75653
75496
  async function addID(config, documents) {
75654
75497
  for (const doc of documents) {
75655
- doc.document = graphql27.visit(doc.document, {
75498
+ doc.document = graphql26.visit(doc.document, {
75656
75499
  Field(node, key, parent2, path3, ancestors) {
75657
75500
  if (!node.selectionSet) {
75658
75501
  return;
@@ -75690,7 +75533,7 @@ function addKeysToSelection(config, node, fieldType) {
75690
75533
  if (!node.selectionSet || node.selectionSet.selections.length == 0) {
75691
75534
  return;
75692
75535
  }
75693
- if (!graphql27.isObjectType(fieldType) && !graphql27.isInterfaceType(fieldType)) {
75536
+ if (!graphql26.isObjectType(fieldType) && !graphql26.isInterfaceType(fieldType)) {
75694
75537
  return;
75695
75538
  }
75696
75539
  const keyFields = config.keyFieldsForType(fieldType.name);
@@ -75705,9 +75548,9 @@ function addKeysToSelection(config, node, fieldType) {
75705
75548
  continue;
75706
75549
  }
75707
75550
  selections.push({
75708
- kind: graphql27.Kind.FIELD,
75551
+ kind: graphql26.Kind.FIELD,
75709
75552
  name: {
75710
- kind: graphql27.Kind.NAME,
75553
+ kind: graphql26.Kind.NAME,
75711
75554
  value: keyField
75712
75555
  }
75713
75556
  });
@@ -75722,13 +75565,13 @@ function addKeysToSelection(config, node, fieldType) {
75722
75565
  }
75723
75566
 
75724
75567
  // src/codegen/transforms/componentFields.ts
75725
- var graphql28 = __toESM(require("graphql"), 1);
75568
+ var graphql27 = __toESM(require("graphql"), 1);
75726
75569
  async function componentFields(config, documents) {
75727
75570
  for (const document of documents) {
75728
- const typeInfo = new graphql28.TypeInfo(config.schema);
75729
- document.document = graphql28.visit(
75571
+ const typeInfo = new graphql27.TypeInfo(config.schema);
75572
+ document.document = graphql27.visit(
75730
75573
  document.document,
75731
- graphql28.visitWithTypeInfo(typeInfo, {
75574
+ graphql27.visitWithTypeInfo(typeInfo, {
75732
75575
  Field(node) {
75733
75576
  const parentType = typeInfo.getParentType();
75734
75577
  if (!parentType) {
@@ -75776,6 +75619,48 @@ async function componentFields(config, documents) {
75776
75619
  }
75777
75620
  }
75778
75621
 
75622
+ // src/codegen/transforms/runtimeScalars.ts
75623
+ var graphql28 = __toESM(require("graphql"), 1);
75624
+ async function addTypename2(config, documents) {
75625
+ for (const doc of documents) {
75626
+ doc.document = graphql28.visit(doc.document, {
75627
+ VariableDefinition(node) {
75628
+ const { type, wrappers } = unwrapType(config, node.type);
75629
+ const runtimeScalar = config.configFile.features?.runtimeScalars?.[type.name];
75630
+ if (runtimeScalar) {
75631
+ return {
75632
+ ...node,
75633
+ type: wrapType({
75634
+ type: config.schema.getType(runtimeScalar.type),
75635
+ wrappers
75636
+ }),
75637
+ directives: [
75638
+ ...node.directives ?? [],
75639
+ {
75640
+ kind: "Directive",
75641
+ name: {
75642
+ kind: "Name",
75643
+ value: config.runtimeScalarDirective
75644
+ },
75645
+ arguments: [
75646
+ {
75647
+ kind: "Argument",
75648
+ name: { kind: "Name", value: "type" },
75649
+ value: {
75650
+ kind: "StringValue",
75651
+ value: type.name
75652
+ }
75653
+ }
75654
+ ]
75655
+ }
75656
+ ]
75657
+ };
75658
+ }
75659
+ }
75660
+ });
75661
+ }
75662
+ }
75663
+
75779
75664
  // src/codegen/validators/typeCheck.ts
75780
75665
  var graphql29 = __toESM(require("graphql"), 1);
75781
75666
  async function typeCheck(config, docs) {
@@ -76777,10 +76662,22 @@ async function componentFields2(config, docs) {
76777
76662
  }
76778
76663
  const fieldValue = fieldArg.value?.kind === "StringValue" ? fieldArg.value.value : void 0;
76779
76664
  const propValue = propArg.value?.kind === "StringValue" ? propArg.value.value : void 0;
76665
+ const existingField = fieldValue && config.componentFields[parent2]?.[fieldValue];
76780
76666
  const parentType = config.schema.getType(parent2);
76781
- if (parentType && fieldValue && (graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue] || config.componentFields[parent2]?.[fieldValue])) {
76667
+ let conflict = false;
76668
+ if (existingField && existingField.filepath !== filepath) {
76669
+ conflict = true;
76670
+ } else if (parentType && fieldValue) {
76671
+ const fieldDef = graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue];
76672
+ if (fieldDef && !fieldDef.astNode?.directives?.find(
76673
+ (dir) => dir.name.value === config.componentFieldDirective
76674
+ )) {
76675
+ conflict = true;
76676
+ }
76677
+ }
76678
+ if (conflict) {
76782
76679
  errors.push({
76783
- message: `Duplicate component field definition for ${parent2}.${fieldValue}`,
76680
+ message: `Duplicate component field definition for ${parent2}.${fieldValue}.` + (existingField ? "The conflicting component field was defined in " + existingField.filepath : ""),
76784
76681
  filepath
76785
76682
  });
76786
76683
  }
@@ -76850,6 +76747,7 @@ async function runPipeline2(config, docs) {
76850
76747
  [
76851
76748
  componentFields2,
76852
76749
  graphqlExtensions,
76750
+ addTypename2,
76853
76751
  ...wrapHook(beforeValidate),
76854
76752
  typeCheck,
76855
76753
  uniqueDocumentNames,
@@ -77994,7 +77892,7 @@ export default app
77994
77892
  async function svelteConfig(targetPath, typescript) {
77995
77893
  const svelteConfigPath = path_exports.join(targetPath, "svelte.config.js");
77996
77894
  const newContentTs = `import adapter from '@sveltejs/adapter-auto';
77997
- import { vitePreprocess } from '@sveltejs/kit/vite';
77895
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
77998
77896
 
77999
77897
  /** @type {import('@sveltejs/kit').Config} */
78000
77898
  const config = {
@@ -78125,12 +78023,12 @@ async function packageJSON(targetPath, frameworkInfo) {
78125
78023
  }
78126
78024
  packageJSON2.devDependencies = {
78127
78025
  ...packageJSON2.devDependencies,
78128
- houdini: "^1.2.43"
78026
+ houdini: "^1.2.45"
78129
78027
  };
78130
78028
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
78131
78029
  packageJSON2.devDependencies = {
78132
78030
  ...packageJSON2.devDependencies,
78133
- "houdini-svelte": "^1.2.43"
78031
+ "houdini-svelte": "^1.2.45"
78134
78032
  };
78135
78033
  } else {
78136
78034
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);