houdini 1.2.44 → 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 (48) hide show
  1. package/build/cmd-cjs/index.js +651 -844
  2. package/build/cmd-esm/index.js +501 -694
  3. package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
  4. package/build/codegen-cjs/index.js +649 -842
  5. package/build/codegen-esm/index.js +499 -692
  6. package/build/lib/graphql.d.ts +1 -1
  7. package/build/lib/index.d.ts +1 -0
  8. package/build/lib/typescript.d.ts +19 -0
  9. package/build/lib-cjs/index.js +667 -464
  10. package/build/lib-esm/index.js +661 -464
  11. package/build/runtime/client/index.d.ts +7 -1
  12. package/build/runtime/client/plugins/fragment.d.ts +2 -2
  13. package/build/runtime/client/plugins/mutation.d.ts +2 -1
  14. package/build/runtime/client/plugins/query.d.ts +2 -2
  15. package/build/runtime/lib/scalars.d.ts +1 -1
  16. package/build/runtime/lib/types.d.ts +13 -2
  17. package/build/runtime/router/types.d.ts +3 -1
  18. package/build/runtime-cjs/client/index.d.ts +7 -1
  19. package/build/runtime-cjs/client/index.js +26 -11
  20. package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
  21. package/build/runtime-cjs/client/plugins/fragment.js +4 -11
  22. package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
  23. package/build/runtime-cjs/client/plugins/mutation.js +8 -15
  24. package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
  25. package/build/runtime-cjs/client/plugins/query.js +4 -11
  26. package/build/runtime-cjs/lib/scalars.d.ts +1 -1
  27. package/build/runtime-cjs/lib/scalars.js +4 -0
  28. package/build/runtime-cjs/lib/types.d.ts +13 -2
  29. package/build/runtime-cjs/router/types.d.ts +3 -1
  30. package/build/runtime-esm/client/index.d.ts +7 -1
  31. package/build/runtime-esm/client/index.js +26 -11
  32. package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
  33. package/build/runtime-esm/client/plugins/fragment.js +1 -2
  34. package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
  35. package/build/runtime-esm/client/plugins/mutation.js +1 -2
  36. package/build/runtime-esm/client/plugins/query.d.ts +2 -2
  37. package/build/runtime-esm/client/plugins/query.js +1 -2
  38. package/build/runtime-esm/lib/scalars.d.ts +1 -1
  39. package/build/runtime-esm/lib/scalars.js +6 -0
  40. package/build/runtime-esm/lib/types.d.ts +13 -2
  41. package/build/runtime-esm/router/types.d.ts +3 -1
  42. package/build/test-cjs/index.js +664 -840
  43. package/build/test-esm/index.js +514 -690
  44. package/build/vite-cjs/index.js +761 -852
  45. package/build/vite-esm/index.js +611 -702
  46. package/package.json +1 -1
  47. package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
  48. package/build/codegen/generators/typescript/types.d.ts +0 -10
@@ -63311,47 +63311,6 @@ function deepMerge(...objects) {
63311
63311
  return mergedObj;
63312
63312
  }
63313
63313
 
63314
- // src/runtime/lib/scalars.ts
63315
- async function marshalSelection({
63316
- selection,
63317
- data
63318
- }) {
63319
- const config = getCurrentConfig();
63320
- if (data === null || typeof data === "undefined") {
63321
- return data;
63322
- }
63323
- if (Array.isArray(data)) {
63324
- return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
63325
- }
63326
- const targetSelection = getFieldsForType(selection, data["__typename"], false);
63327
- return Object.fromEntries(
63328
- await Promise.all(
63329
- Object.entries(data).map(async ([fieldName, value]) => {
63330
- const { type, selection: selection2 } = targetSelection[fieldName];
63331
- if (!type) {
63332
- return [fieldName, value];
63333
- }
63334
- if (selection2) {
63335
- return [fieldName, await marshalSelection({ selection: selection2, data: value })];
63336
- }
63337
- if (config.scalars?.[type]) {
63338
- const marshalFn = config.scalars[type].marshal;
63339
- if (!marshalFn) {
63340
- throw new Error(
63341
- `scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
63342
- );
63343
- }
63344
- if (Array.isArray(value)) {
63345
- return [fieldName, value.map(marshalFn)];
63346
- }
63347
- return [fieldName, marshalFn(value)];
63348
- }
63349
- return [fieldName, value];
63350
- })
63351
- )
63352
- );
63353
- }
63354
-
63355
63314
  // src/runtime/lib/types.ts
63356
63315
  var CachePolicy = {
63357
63316
  CacheOrNetwork: "CacheOrNetwork",
@@ -63379,11 +63338,6 @@ var RefetchUpdateMode = {
63379
63338
  prepend: "prepend",
63380
63339
  replace: "replace"
63381
63340
  };
63382
- var DataSource = {
63383
- Cache: "cache",
63384
- Network: "network",
63385
- Ssr: "ssr"
63386
- };
63387
63341
  var fragmentKey = " $fragments";
63388
63342
  var PendingValue = Symbol("houdini_loading");
63389
63343
 
@@ -67291,202 +67245,6 @@ var cache_default = new Cache();
67291
67245
  // src/runtime/client/plugins/cache.ts
67292
67246
  var serverSide = typeof globalThis.window === "undefined";
67293
67247
 
67294
- // src/runtime/client/utils/documentPlugins.ts
67295
- var documentPlugin = (kind, source) => {
67296
- return () => {
67297
- const sourceHandlers = source();
67298
- const enterWrapper = (handler) => {
67299
- return !handler ? void 0 : (ctx, handlers) => {
67300
- if (ctx.artifact.kind !== kind) {
67301
- return handlers.next(ctx);
67302
- }
67303
- return handler(ctx, handlers);
67304
- };
67305
- };
67306
- const exitWrapper = (handler) => {
67307
- return !handler ? void 0 : (ctx, handlers) => {
67308
- if (ctx.artifact.kind !== kind) {
67309
- return handlers.resolve(ctx);
67310
- }
67311
- return handler(ctx, handlers);
67312
- };
67313
- };
67314
- return {
67315
- start: enterWrapper(sourceHandlers.start),
67316
- network: enterWrapper(sourceHandlers.network),
67317
- afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
67318
- end: exitWrapper(sourceHandlers.end),
67319
- catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
67320
- cleanup: (...args) => sourceHandlers.cleanup?.(...args)
67321
- };
67322
- };
67323
- };
67324
-
67325
- // src/runtime/client/plugins/query.ts
67326
- var query = documentPlugin(ArtifactKind.Query, function() {
67327
- let subscriptionSpec = null;
67328
- let lastVariables = null;
67329
- return {
67330
- start(ctx, { next }) {
67331
- const runtimeScalarPayload = {
67332
- session: ctx.session
67333
- };
67334
- ctx.variables = {
67335
- ...lastVariables,
67336
- ...Object.fromEntries(
67337
- Object.entries(ctx.artifact.input?.runtimeScalars ?? {}).map(
67338
- ([field, type]) => {
67339
- const runtimeScalar = ctx.config.features?.runtimeScalars?.[type];
67340
- if (!runtimeScalar) {
67341
- return [field, type];
67342
- }
67343
- return [field, runtimeScalar.resolve(runtimeScalarPayload)];
67344
- }
67345
- )
67346
- ),
67347
- ...ctx.variables
67348
- };
67349
- next(ctx);
67350
- },
67351
- end(ctx, { resolve: resolve2, marshalVariables, variablesChanged }) {
67352
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
67353
- if (subscriptionSpec) {
67354
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
67355
- }
67356
- lastVariables = { ...marshalVariables(ctx) };
67357
- const variables = lastVariables;
67358
- subscriptionSpec = {
67359
- rootType: ctx.artifact.rootType,
67360
- selection: ctx.artifact.selection,
67361
- variables: () => variables,
67362
- set: (newValue) => {
67363
- resolve2(ctx, {
67364
- data: newValue,
67365
- errors: null,
67366
- fetching: false,
67367
- partial: false,
67368
- stale: false,
67369
- source: DataSource.Cache,
67370
- variables: ctx.variables ?? {}
67371
- });
67372
- }
67373
- };
67374
- cache_default.subscribe(subscriptionSpec, lastVariables);
67375
- }
67376
- resolve2(ctx);
67377
- },
67378
- cleanup() {
67379
- if (subscriptionSpec) {
67380
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
67381
- lastVariables = null;
67382
- }
67383
- }
67384
- };
67385
- });
67386
-
67387
- // src/runtime/client/plugins/fragment.ts
67388
- var fragment = documentPlugin(ArtifactKind.Fragment, function() {
67389
- let subscriptionSpec = null;
67390
- let lastReference = null;
67391
- return {
67392
- start(ctx, { next, resolve: resolve2, variablesChanged, marshalVariables }) {
67393
- if (!ctx.stuff.parentID) {
67394
- return next(ctx);
67395
- }
67396
- const currentReference = {
67397
- parent: ctx.stuff.parentID,
67398
- variables: marshalVariables(ctx)
67399
- };
67400
- if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged(ctx))) {
67401
- if (subscriptionSpec) {
67402
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
67403
- }
67404
- const variables = marshalVariables(ctx);
67405
- subscriptionSpec = {
67406
- rootType: ctx.artifact.rootType,
67407
- selection: ctx.artifact.selection,
67408
- variables: () => variables,
67409
- parentID: ctx.stuff.parentID,
67410
- set: (newValue) => {
67411
- resolve2(ctx, {
67412
- data: newValue,
67413
- errors: null,
67414
- fetching: false,
67415
- partial: false,
67416
- stale: false,
67417
- source: DataSource.Cache,
67418
- variables
67419
- });
67420
- }
67421
- };
67422
- cache_default.subscribe(subscriptionSpec, variables);
67423
- lastReference = currentReference;
67424
- }
67425
- next(ctx);
67426
- },
67427
- cleanup() {
67428
- if (subscriptionSpec) {
67429
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
67430
- }
67431
- }
67432
- };
67433
- });
67434
-
67435
- // src/runtime/client/plugins/mutation.ts
67436
- var mutation = documentPlugin(ArtifactKind.Mutation, () => {
67437
- return {
67438
- async start(ctx, { next, marshalVariables }) {
67439
- const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
67440
- const optimisticResponse = ctx.stuff.optimisticResponse;
67441
- let toNotify = [];
67442
- if (optimisticResponse) {
67443
- toNotify = cache_default.write({
67444
- selection: ctx.artifact.selection,
67445
- data: await marshalSelection({
67446
- selection: ctx.artifact.selection,
67447
- data: optimisticResponse
67448
- }),
67449
- variables: marshalVariables(ctx),
67450
- layer: layerOptimistic.id
67451
- });
67452
- }
67453
- ctx.cacheParams = {
67454
- ...ctx.cacheParams,
67455
- layer: layerOptimistic,
67456
- notifySubscribers: toNotify,
67457
- forceNotify: true
67458
- };
67459
- next(ctx);
67460
- },
67461
- afterNetwork(ctx, { resolve: resolve2 }) {
67462
- if (ctx.cacheParams?.layer) {
67463
- cache_default.clearLayer(ctx.cacheParams.layer.id);
67464
- }
67465
- resolve2(ctx);
67466
- },
67467
- end(ctx, { resolve: resolve2, value }) {
67468
- const hasErrors = value.errors && value.errors.length > 0;
67469
- if (hasErrors) {
67470
- if (ctx.cacheParams?.layer) {
67471
- cache_default.clearLayer(ctx.cacheParams.layer.id);
67472
- }
67473
- }
67474
- if (ctx.cacheParams?.layer) {
67475
- cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
67476
- }
67477
- resolve2(ctx);
67478
- },
67479
- catch(ctx, { error }) {
67480
- if (ctx.cacheParams?.layer) {
67481
- const { layer } = ctx.cacheParams;
67482
- cache_default.clearLayer(layer.id);
67483
- cache_default._internal_unstable.storage.resolveLayer(layer.id);
67484
- }
67485
- throw error;
67486
- }
67487
- };
67488
- });
67489
-
67490
67248
  // src/lib/types.ts
67491
67249
  var LogLevel = {
67492
67250
  Full: "full",
@@ -68499,7 +68257,7 @@ function formatErrors(e3, afterError) {
68499
68257
  afterError?.(e3);
68500
68258
  }
68501
68259
  }
68502
- function unwrapType(config, type, wrappers = []) {
68260
+ function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
68503
68261
  if (type.kind === "NonNullType") {
68504
68262
  return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
68505
68263
  }
@@ -68515,6 +68273,11 @@ function unwrapType(config, type, wrappers = []) {
68515
68273
  if (type instanceof graphql3.GraphQLList) {
68516
68274
  return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
68517
68275
  }
68276
+ if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
68277
+ type = config.schema.getType(
68278
+ config.configFile.features?.runtimeScalars?.[type.name.value].type
68279
+ );
68280
+ }
68518
68281
  const namedType = config.schema.getType(type.name.value || type.name);
68519
68282
  if (!namedType) {
68520
68283
  throw new Error("Unknown type: " + type.name.value || type.name);
@@ -68709,6 +68472,152 @@ async function detectTools(cwd = process.cwd()) {
68709
68472
  };
68710
68473
  }
68711
68474
 
68475
+ // src/lib/typescript.ts
68476
+ var recast2 = __toESM(require_main2(), 1);
68477
+ import * as graphql4 from "graphql";
68478
+ var AST2 = recast2.types.builders;
68479
+ function unwrappedTsTypeReference(config, filepath, missingScalars, {
68480
+ type,
68481
+ wrappers
68482
+ }, body) {
68483
+ let result;
68484
+ if (graphql4.isScalarType(type)) {
68485
+ result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
68486
+ } else if (graphql4.isEnumType(type)) {
68487
+ result = enumReference(config, body, type.name);
68488
+ } else {
68489
+ result = AST2.tsTypeReference(AST2.identifier(type.name));
68490
+ }
68491
+ for (const toWrap of wrappers) {
68492
+ if (toWrap === "NonNull" /* NonNull */) {
68493
+ continue;
68494
+ } else if (toWrap === "Nullable" /* Nullable */) {
68495
+ result = nullableField(result, true);
68496
+ } else if (toWrap === "List" /* List */) {
68497
+ result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
68498
+ }
68499
+ }
68500
+ return result;
68501
+ }
68502
+ function tsTypeReference(config, filepath, missingScalars, definition, body) {
68503
+ const { type, wrappers } = unwrapType(config, definition.type);
68504
+ return unwrappedTsTypeReference(
68505
+ config,
68506
+ filepath,
68507
+ missingScalars,
68508
+ { type, wrappers },
68509
+ body
68510
+ );
68511
+ }
68512
+ function enumReference(config, body, name) {
68513
+ ensureImports({
68514
+ config,
68515
+ body,
68516
+ import: ["ValueOf"],
68517
+ importKind: "type",
68518
+ sourceModule: "$houdini/runtime/lib/types"
68519
+ });
68520
+ return AST2.tsTypeReference(
68521
+ AST2.identifier("ValueOf"),
68522
+ AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
68523
+ );
68524
+ }
68525
+ function readonlyProperty(prop, enable = true) {
68526
+ if (enable) {
68527
+ prop.readonly = true;
68528
+ }
68529
+ return prop;
68530
+ }
68531
+ function nullableField(inner, input = false) {
68532
+ const members = [inner, AST2.tsNullKeyword()];
68533
+ if (input) {
68534
+ members.push(AST2.tsUndefinedKeyword());
68535
+ }
68536
+ return AST2.tsUnionType(members);
68537
+ }
68538
+ function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
68539
+ if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
68540
+ if (!field) {
68541
+ return AST2.tsNeverKeyword();
68542
+ }
68543
+ const component = config.componentFields[field.parent][field.field];
68544
+ const sourcePathRelative = path_exports.relative(
68545
+ path_exports.join(config.projectRoot, "src"),
68546
+ component.filepath
68547
+ );
68548
+ let sourcePathParsed = path_exports.parse(sourcePathRelative);
68549
+ let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
68550
+ const localImport = ensureImports({
68551
+ config,
68552
+ body,
68553
+ import: "__component__" + component.fragment,
68554
+ sourceModule: path_exports.join(
68555
+ path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
68556
+ "src",
68557
+ sourcePath
68558
+ )
68559
+ }) ?? "__component__" + component.fragment;
68560
+ const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
68561
+ parameters.typeParameters = AST2.tsTypeParameterInstantiation([
68562
+ AST2.tsTypeQuery(AST2.identifier(localImport))
68563
+ ]);
68564
+ const indexed = AST2.tsIndexedAccessType(
68565
+ parameters,
68566
+ AST2.tsLiteralType(AST2.numericLiteral(0))
68567
+ );
68568
+ const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
68569
+ omit.typeParameters = AST2.tsTypeParameterInstantiation([
68570
+ indexed,
68571
+ AST2.tsLiteralType(AST2.stringLiteral(component.prop))
68572
+ ]);
68573
+ const arg = AST2.identifier("props");
68574
+ arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
68575
+ const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
68576
+ returnType.typeParameters = AST2.tsTypeParameterInstantiation([
68577
+ AST2.tsTypeQuery(AST2.identifier(localImport))
68578
+ ]);
68579
+ const fnType = AST2.tsFunctionType([arg]);
68580
+ fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
68581
+ return fnType;
68582
+ }
68583
+ switch (target.name) {
68584
+ case "String": {
68585
+ return AST2.tsStringKeyword();
68586
+ }
68587
+ case "Int": {
68588
+ return AST2.tsNumberKeyword();
68589
+ }
68590
+ case "Float": {
68591
+ return AST2.tsNumberKeyword();
68592
+ }
68593
+ case "Boolean": {
68594
+ return AST2.tsBooleanKeyword();
68595
+ }
68596
+ case "ID": {
68597
+ return AST2.tsStringKeyword();
68598
+ }
68599
+ default: {
68600
+ if (graphql4.isNonNullType(target) && "ofType" in target) {
68601
+ return scalarPropertyValue(
68602
+ config,
68603
+ filepath,
68604
+ missingScalars,
68605
+ target.ofType,
68606
+ body,
68607
+ field
68608
+ );
68609
+ }
68610
+ if (config.scalars?.[target.name]) {
68611
+ return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
68612
+ }
68613
+ if (target.name !== config.componentScalar) {
68614
+ missingScalars.add(target.name);
68615
+ }
68616
+ return AST2.tsAnyKeyword();
68617
+ }
68618
+ }
68619
+ }
68620
+
68712
68621
  // ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
68713
68622
  var WalkerBase = class {
68714
68623
  constructor() {
@@ -68822,7 +68731,7 @@ async function asyncWalk(ast, { enter, leave }) {
68822
68731
  }
68823
68732
 
68824
68733
  // src/lib/walk.ts
68825
- import * as graphql4 from "graphql";
68734
+ import * as graphql5 from "graphql";
68826
68735
  async function find_graphql(config, parsedScript, walker) {
68827
68736
  await asyncWalk(parsedScript, {
68828
68737
  async enter(node, parent2) {
@@ -68877,7 +68786,7 @@ async function find_graphql(config, parsedScript, walker) {
68877
68786
  } else if (!documentString) {
68878
68787
  return;
68879
68788
  }
68880
- const parsedTag = graphql4.parse(documentString);
68789
+ const parsedTag = graphql5.parse(documentString);
68881
68790
  if (walker.where && !walker.where(parsedTag, { node, parent: parent2 })) {
68882
68791
  return;
68883
68792
  }
@@ -69009,7 +68918,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
69009
68918
  };
69010
68919
  return defs.concat([
69011
68920
  {
69012
- raw: graphql4.print(parsed),
68921
+ raw: graphql5.print(parsed),
69013
68922
  parsed
69014
68923
  }
69015
68924
  ]);
@@ -69024,7 +68933,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
69024
68933
 
69025
68934
  // src/lib/router/manifest.ts
69026
68935
  var t2 = __toESM(require_lib6(), 1);
69027
- import * as graphql5 from "graphql";
68936
+ import * as graphql6 from "graphql";
69028
68937
 
69029
68938
  // src/lib/router/server.ts
69030
68939
  import path2 from "node:path";
@@ -69062,11 +68971,11 @@ async function loadLocalSchema(config) {
69062
68971
  }
69063
68972
 
69064
68973
  // src/codegen/index.ts
69065
- import * as graphql33 from "graphql";
68974
+ import * as graphql32 from "graphql";
69066
68975
 
69067
68976
  // src/codegen/generators/artifacts/index.ts
69068
- var recast4 = __toESM(require_main2(), 1);
69069
- import * as graphql16 from "graphql";
68977
+ var recast5 = __toESM(require_main2(), 1);
68978
+ import * as graphql17 from "graphql";
69070
68979
 
69071
68980
  // src/codegen/utils/commonjs.ts
69072
68981
  var cjsIndexFilePreamble = `"use strict";
@@ -69308,19 +69217,19 @@ var FieldCollection = class {
69308
69217
  };
69309
69218
 
69310
69219
  // src/codegen/utils/moduleExport.ts
69311
- var recast2 = __toESM(require_main2(), 1);
69312
- var AST2 = recast2.types.builders;
69220
+ var recast3 = __toESM(require_main2(), 1);
69221
+ var AST3 = recast3.types.builders;
69313
69222
  function moduleExport(config, key, value) {
69314
69223
  if (config.module === "commonjs") {
69315
- let target = AST2.memberExpression(AST2.identifier("module"), AST2.identifier("exports"));
69224
+ let target = AST3.memberExpression(AST3.identifier("module"), AST3.identifier("exports"));
69316
69225
  if (key !== "default") {
69317
- target = AST2.memberExpression(target, AST2.identifier(key));
69226
+ target = AST3.memberExpression(target, AST3.identifier(key));
69318
69227
  }
69319
- return AST2.expressionStatement(AST2.assignmentExpression("=", target, value));
69228
+ return AST3.expressionStatement(AST3.assignmentExpression("=", target, value));
69320
69229
  }
69321
- return key === "default" ? AST2.exportDefaultDeclaration(value) : AST2.exportNamedDeclaration(
69322
- AST2.variableDeclaration("const", [
69323
- AST2.variableDeclarator(AST2.identifier(key), value)
69230
+ return key === "default" ? AST3.exportDefaultDeclaration(value) : AST3.exportNamedDeclaration(
69231
+ AST3.variableDeclaration("const", [
69232
+ AST3.variableDeclarator(AST3.identifier(key), value)
69324
69233
  ])
69325
69234
  );
69326
69235
  }
@@ -69577,7 +69486,7 @@ var serialize = (value, { json, lossy } = {}) => {
69577
69486
  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));
69578
69487
 
69579
69488
  // src/codegen/transforms/fragmentVariables.ts
69580
- import * as graphql7 from "graphql";
69489
+ import * as graphql8 from "graphql";
69581
69490
 
69582
69491
  // src/codegen/utils/stripLoc.ts
69583
69492
  function stripLoc(value) {
@@ -69598,7 +69507,7 @@ function stripLoc(value) {
69598
69507
  }
69599
69508
 
69600
69509
  // src/codegen/transforms/collectDefinitions.ts
69601
- import * as graphql6 from "graphql";
69510
+ import * as graphql7 from "graphql";
69602
69511
  import { Kind as GraphqlKinds } from "graphql";
69603
69512
  async function includeFragmentDefinitions(config, documents) {
69604
69513
  const fragments = collectDefinitions(config, documents);
@@ -69648,10 +69557,10 @@ function collectDefinitions(config, docs) {
69648
69557
  }
69649
69558
  function findRequiredFragments(config, definition) {
69650
69559
  const referencedFragments = [];
69651
- const typeInfo = new graphql6.TypeInfo(config.schema);
69652
- definition.selectionSet = graphql6.visit(
69560
+ const typeInfo = new graphql7.TypeInfo(config.schema);
69561
+ definition.selectionSet = graphql7.visit(
69653
69562
  definition,
69654
- graphql6.visitWithTypeInfo(typeInfo, {
69563
+ graphql7.visitWithTypeInfo(typeInfo, {
69655
69564
  FragmentSpread(node) {
69656
69565
  referencedFragments.push(node.name.value);
69657
69566
  }
@@ -69685,7 +69594,7 @@ function flattenFragments(filepath, operation, fragments) {
69685
69594
  }
69686
69595
 
69687
69596
  // src/codegen/transforms/fragmentVariables.ts
69688
- var GraphqlKinds2 = graphql7.Kind;
69597
+ var GraphqlKinds2 = graphql8.Kind;
69689
69598
  async function fragmentVariables(config, documents) {
69690
69599
  const fragments = collectDefinitions(config, documents);
69691
69600
  const generatedFragments = {};
@@ -69708,7 +69617,7 @@ async function fragmentVariables(config, documents) {
69708
69617
  });
69709
69618
  }
69710
69619
  const doc = {
69711
- kind: graphql7.Kind.DOCUMENT,
69620
+ kind: graphql8.Kind.DOCUMENT,
69712
69621
  definitions: Object.values(generatedFragments)
69713
69622
  };
69714
69623
  documents.push({
@@ -69779,7 +69688,7 @@ function inlineFragmentArgs({
69779
69688
  return null;
69780
69689
  };
69781
69690
  const result = esm_default(
69782
- graphql7.visit(document, {
69691
+ graphql8.visit(document, {
69783
69692
  FragmentSpread(node) {
69784
69693
  if (!fragmentDefinitions[node.name.value]) {
69785
69694
  throw new Error("Could not find definition for fragment" + node.name.value);
@@ -69865,7 +69774,7 @@ function inlineFragmentArgs({
69865
69774
  );
69866
69775
  if (newName) {
69867
69776
  result.name = {
69868
- kind: graphql7.Kind.NAME,
69777
+ kind: graphql8.Kind.NAME,
69869
69778
  value: newName
69870
69779
  };
69871
69780
  }
@@ -70032,7 +69941,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
70032
69941
  }
70033
69942
 
70034
69943
  // src/codegen/generators/artifacts/inputs.ts
70035
- import * as graphql8 from "graphql";
69944
+ import * as graphql9 from "graphql";
70036
69945
  function inputObject(config, inputs, runtimeScalars) {
70037
69946
  const visitedTypes = /* @__PURE__ */ new Set();
70038
69947
  const inputObj = {
@@ -70062,10 +69971,10 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
70062
69971
  if (visitedTypes.has(type.name)) {
70063
69972
  return;
70064
69973
  }
70065
- if (graphql8.isEnumType(type) || graphql8.isScalarType(type)) {
69974
+ if (graphql9.isEnumType(type) || graphql9.isScalarType(type)) {
70066
69975
  return;
70067
69976
  }
70068
- if (graphql8.isUnionType(type)) {
69977
+ if (graphql9.isUnionType(type)) {
70069
69978
  return;
70070
69979
  }
70071
69980
  visitedTypes.add(type.name);
@@ -70083,50 +69992,50 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
70083
69992
  }
70084
69993
 
70085
69994
  // src/codegen/generators/artifacts/operations.ts
70086
- import * as graphql10 from "graphql";
69995
+ import * as graphql11 from "graphql";
70087
69996
 
70088
69997
  // src/codegen/generators/artifacts/utils.ts
70089
- var recast3 = __toESM(require_main2(), 1);
70090
- import * as graphql9 from "graphql";
70091
- var AST3 = recast3.types.builders;
69998
+ var recast4 = __toESM(require_main2(), 1);
69999
+ import * as graphql10 from "graphql";
70000
+ var AST4 = recast4.types.builders;
70092
70001
  function serializeValue(value) {
70093
70002
  if (Array.isArray(value)) {
70094
- return AST3.arrayExpression(value.map(serializeValue));
70003
+ return AST4.arrayExpression(value.map(serializeValue));
70095
70004
  }
70096
70005
  if (typeof value === "object" && value !== null) {
70097
- return AST3.objectExpression(
70006
+ return AST4.objectExpression(
70098
70007
  Object.entries(value).filter(([key, value2]) => typeof value2 !== "undefined").map(([key, val]) => {
70099
- return AST3.objectProperty(AST3.stringLiteral(key), serializeValue(val));
70008
+ return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
70100
70009
  })
70101
70010
  );
70102
70011
  }
70103
70012
  if (typeof value === "string") {
70104
70013
  if (value.indexOf("\n") !== -1) {
70105
- return AST3.templateLiteral(
70106
- [AST3.templateElement({ raw: value, cooked: value }, true)],
70014
+ return AST4.templateLiteral(
70015
+ [AST4.templateElement({ raw: value, cooked: value }, true)],
70107
70016
  []
70108
70017
  );
70109
70018
  }
70110
- return AST3.stringLiteral(value);
70019
+ return AST4.stringLiteral(value);
70111
70020
  }
70112
- return AST3.literal(value);
70021
+ return AST4.literal(value);
70113
70022
  }
70114
70023
  function convertValue(config, val) {
70115
70024
  let value;
70116
70025
  let kind;
70117
- if (val.kind === graphql9.Kind.INT) {
70026
+ if (val.kind === graphql10.Kind.INT) {
70118
70027
  value = parseInt(val.value, 10);
70119
70028
  kind = "Int";
70120
- } else if (val.kind === graphql9.Kind.FLOAT) {
70029
+ } else if (val.kind === graphql10.Kind.FLOAT) {
70121
70030
  value = parseFloat(val.value);
70122
70031
  kind = "Float";
70123
- } else if (val.kind === graphql9.Kind.BOOLEAN) {
70032
+ } else if (val.kind === graphql10.Kind.BOOLEAN) {
70124
70033
  value = val.value;
70125
70034
  kind = "Boolean";
70126
- } else if (val.kind === graphql9.Kind.VARIABLE) {
70035
+ } else if (val.kind === graphql10.Kind.VARIABLE) {
70127
70036
  value = val.name.value;
70128
70037
  kind = "Variable";
70129
- } else if (val.kind === graphql9.Kind.STRING) {
70038
+ } else if (val.kind === graphql10.Kind.STRING) {
70130
70039
  value = val.value;
70131
70040
  kind = "String";
70132
70041
  }
@@ -70139,7 +70048,7 @@ function operationsByPath(config, filepath, definition, filterTypes) {
70139
70048
  return {};
70140
70049
  }
70141
70050
  const pathOperations = {};
70142
- graphql10.visit(definition, {
70051
+ graphql11.visit(definition, {
70143
70052
  FragmentSpread(node, _3, __, ___, ancestors) {
70144
70053
  if (!config.isListFragment(node.name.value)) {
70145
70054
  return;
@@ -70298,19 +70207,19 @@ function ancestorKey(ancestors) {
70298
70207
  }
70299
70208
 
70300
70209
  // src/codegen/generators/artifacts/selection.ts
70301
- import * as graphql15 from "graphql";
70210
+ import * as graphql16 from "graphql";
70302
70211
 
70303
70212
  // src/codegen/transforms/list.ts
70304
- import * as graphql13 from "graphql";
70213
+ import * as graphql14 from "graphql";
70305
70214
 
70306
70215
  // src/codegen/utils/objectIdentificationSelection.ts
70307
- import * as graphql11 from "graphql";
70216
+ import * as graphql12 from "graphql";
70308
70217
  var objectIdentificationSelection = (config, type) => {
70309
70218
  return config.keyFieldsForType(type.name).map((key) => {
70310
70219
  return {
70311
- kind: graphql11.Kind.FIELD,
70220
+ kind: graphql12.Kind.FIELD,
70312
70221
  name: {
70313
- kind: graphql11.Kind.NAME,
70222
+ kind: graphql12.Kind.NAME,
70314
70223
  value: key
70315
70224
  }
70316
70225
  };
@@ -70318,7 +70227,7 @@ var objectIdentificationSelection = (config, type) => {
70318
70227
  };
70319
70228
 
70320
70229
  // src/codegen/transforms/paginate.ts
70321
- import * as graphql12 from "graphql";
70230
+ import * as graphql13 from "graphql";
70322
70231
  async function paginate(config, documents) {
70323
70232
  const newDocs = [];
70324
70233
  for (const doc of documents) {
@@ -70351,7 +70260,7 @@ async function paginate(config, documents) {
70351
70260
  };
70352
70261
  let cursorType = "String";
70353
70262
  let paginationPath = [];
70354
- doc.document = graphql12.visit(doc.document, {
70263
+ doc.document = graphql13.visit(doc.document, {
70355
70264
  Field(node, _3, __, ___, ancestors) {
70356
70265
  const paginateDirective = node.directives?.find(
70357
70266
  (directive) => directive.name.value === config.paginateDirective
@@ -70377,7 +70286,7 @@ async function paginate(config, documents) {
70377
70286
  flags.offset.enabled = offsetPagination;
70378
70287
  flags.limit.enabled = offsetPagination;
70379
70288
  paginationPath = ancestors.filter(
70380
- (ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql12.Kind.FIELD
70289
+ (ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql13.Kind.FIELD
70381
70290
  ).concat(node).map((field) => field.alias?.value || field.name.value);
70382
70291
  return {
70383
70292
  ...node,
@@ -70396,7 +70305,7 @@ async function paginate(config, documents) {
70396
70305
  let fragment2 = "";
70397
70306
  let paginateMode = config.defaultPaginateMode;
70398
70307
  const requiredArgs = [];
70399
- doc.document = graphql12.visit(doc.document, {
70308
+ doc.document = graphql13.visit(doc.document, {
70400
70309
  OperationDefinition(node) {
70401
70310
  if (node.operation !== "query") {
70402
70311
  throw new HoudiniError({
@@ -70455,9 +70364,9 @@ async function paginate(config, documents) {
70455
70364
  directives: [
70456
70365
  ...node.directives || [],
70457
70366
  {
70458
- kind: graphql12.Kind.DIRECTIVE,
70367
+ kind: graphql13.Kind.DIRECTIVE,
70459
70368
  name: {
70460
- kind: graphql12.Kind.NAME,
70369
+ kind: graphql13.Kind.NAME,
70461
70370
  value: config.argumentsDirective
70462
70371
  }
70463
70372
  }
@@ -70527,22 +70436,22 @@ async function paginate(config, documents) {
70527
70436
  const paginationArgs = Object.entries(flags).filter(([_3, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
70528
70437
  const fragmentSpreadSelection = [
70529
70438
  {
70530
- kind: graphql12.Kind.FRAGMENT_SPREAD,
70439
+ kind: graphql13.Kind.FRAGMENT_SPREAD,
70531
70440
  name: {
70532
- kind: graphql12.Kind.NAME,
70441
+ kind: graphql13.Kind.NAME,
70533
70442
  value: fragmentName
70534
70443
  },
70535
70444
  directives: [
70536
70445
  {
70537
- kind: graphql12.Kind.DIRECTIVE,
70446
+ kind: graphql13.Kind.DIRECTIVE,
70538
70447
  name: {
70539
- kind: graphql12.Kind.NAME,
70448
+ kind: graphql13.Kind.NAME,
70540
70449
  value: config.withDirective
70541
70450
  },
70542
70451
  ["arguments"]: requiredArgs.map((arg) => variableAsArgument(arg.name)).concat(paginationArgs.map(({ name }) => variableAsArgument(name)))
70543
70452
  },
70544
70453
  {
70545
- kind: graphql12.Kind.DIRECTIVE,
70454
+ kind: graphql13.Kind.DIRECTIVE,
70546
70455
  name: {
70547
70456
  kind: "Name",
70548
70457
  value: config.maskDisableDirective
@@ -70569,23 +70478,23 @@ async function paginate(config, documents) {
70569
70478
  });
70570
70479
  const typeConfig = config.typeConfig?.[fragment2];
70571
70480
  const queryDoc = {
70572
- kind: graphql12.Kind.DOCUMENT,
70481
+ kind: graphql13.Kind.DOCUMENT,
70573
70482
  definitions: [
70574
70483
  {
70575
- kind: graphql12.Kind.OPERATION_DEFINITION,
70484
+ kind: graphql13.Kind.OPERATION_DEFINITION,
70576
70485
  name: {
70577
- kind: graphql12.Kind.NAME,
70486
+ kind: graphql13.Kind.NAME,
70578
70487
  value: refetchQueryName
70579
70488
  },
70580
70489
  operation: "query",
70581
70490
  variableDefinitions: requiredArgs.map(
70582
70491
  (arg) => ({
70583
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70492
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70584
70493
  type: arg.type,
70585
70494
  variable: {
70586
- kind: graphql12.Kind.VARIABLE,
70495
+ kind: graphql13.Kind.VARIABLE,
70587
70496
  name: {
70588
- kind: graphql12.Kind.NAME,
70497
+ kind: graphql13.Kind.NAME,
70589
70498
  value: arg.name
70590
70499
  }
70591
70500
  }
@@ -70593,18 +70502,18 @@ async function paginate(config, documents) {
70593
70502
  ).concat(
70594
70503
  paginationArgs.map(
70595
70504
  (arg) => ({
70596
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70505
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70597
70506
  type: {
70598
- kind: graphql12.Kind.NAMED_TYPE,
70507
+ kind: graphql13.Kind.NAMED_TYPE,
70599
70508
  name: {
70600
- kind: graphql12.Kind.NAME,
70509
+ kind: graphql13.Kind.NAME,
70601
70510
  value: arg.type
70602
70511
  }
70603
70512
  },
70604
70513
  variable: {
70605
- kind: graphql12.Kind.VARIABLE,
70514
+ kind: graphql13.Kind.VARIABLE,
70606
70515
  name: {
70607
- kind: graphql12.Kind.NAME,
70516
+ kind: graphql13.Kind.NAME,
70608
70517
  value: arg.name
70609
70518
  }
70610
70519
  },
@@ -70616,12 +70525,12 @@ async function paginate(config, documents) {
70616
70525
  ).concat(
70617
70526
  !nodeQuery ? [] : keys2.map(
70618
70527
  (key) => ({
70619
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70528
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70620
70529
  type: key.type,
70621
70530
  variable: {
70622
- kind: graphql12.Kind.VARIABLE,
70531
+ kind: graphql13.Kind.VARIABLE,
70623
70532
  name: {
70624
- kind: graphql12.Kind.NAME,
70533
+ kind: graphql13.Kind.NAME,
70625
70534
  value: key.name
70626
70535
  }
70627
70536
  }
@@ -70630,42 +70539,42 @@ async function paginate(config, documents) {
70630
70539
  )
70631
70540
  ),
70632
70541
  selectionSet: {
70633
- kind: graphql12.Kind.SELECTION_SET,
70542
+ kind: graphql13.Kind.SELECTION_SET,
70634
70543
  selections: !nodeQuery ? fragmentSpreadSelection : [
70635
70544
  {
70636
- kind: graphql12.Kind.FIELD,
70545
+ kind: graphql13.Kind.FIELD,
70637
70546
  name: {
70638
- kind: graphql12.Kind.NAME,
70547
+ kind: graphql13.Kind.NAME,
70639
70548
  value: typeConfig?.resolve?.queryField || "node"
70640
70549
  },
70641
70550
  ["arguments"]: keys2.map((key) => ({
70642
- kind: graphql12.Kind.ARGUMENT,
70551
+ kind: graphql13.Kind.ARGUMENT,
70643
70552
  name: {
70644
- kind: graphql12.Kind.NAME,
70553
+ kind: graphql13.Kind.NAME,
70645
70554
  value: key.name
70646
70555
  },
70647
70556
  value: {
70648
- kind: graphql12.Kind.VARIABLE,
70557
+ kind: graphql13.Kind.VARIABLE,
70649
70558
  name: {
70650
- kind: graphql12.Kind.NAME,
70559
+ kind: graphql13.Kind.NAME,
70651
70560
  value: key.name
70652
70561
  }
70653
70562
  }
70654
70563
  })),
70655
70564
  selectionSet: {
70656
- kind: graphql12.Kind.SELECTION_SET,
70565
+ kind: graphql13.Kind.SELECTION_SET,
70657
70566
  selections: [
70658
70567
  {
70659
- kind: graphql12.Kind.FIELD,
70568
+ kind: graphql13.Kind.FIELD,
70660
70569
  name: {
70661
- kind: graphql12.Kind.NAME,
70570
+ kind: graphql13.Kind.NAME,
70662
70571
  value: "__typename"
70663
70572
  }
70664
70573
  },
70665
70574
  ...(typeConfig?.keys || [config.defaultKeys[0]]).map((key) => ({
70666
- kind: graphql12.Kind.FIELD,
70575
+ kind: graphql13.Kind.FIELD,
70667
70576
  name: {
70668
- kind: graphql12.Kind.NAME,
70577
+ kind: graphql13.Kind.NAME,
70669
70578
  value: key
70670
70579
  }
70671
70580
  })),
@@ -70722,15 +70631,15 @@ function replaceArgumentsWithVariables(args, flags) {
70722
70631
  }
70723
70632
  function variableAsArgument(name, variable) {
70724
70633
  return {
70725
- kind: graphql12.Kind.ARGUMENT,
70634
+ kind: graphql13.Kind.ARGUMENT,
70726
70635
  name: {
70727
- kind: graphql12.Kind.NAME,
70636
+ kind: graphql13.Kind.NAME,
70728
70637
  value: name
70729
70638
  },
70730
70639
  value: {
70731
- kind: graphql12.Kind.VARIABLE,
70640
+ kind: graphql13.Kind.VARIABLE,
70732
70641
  name: {
70733
- kind: graphql12.Kind.NAME,
70642
+ kind: graphql13.Kind.NAME,
70734
70643
  value: variable ?? name
70735
70644
  }
70736
70645
  }
@@ -70738,18 +70647,18 @@ function variableAsArgument(name, variable) {
70738
70647
  }
70739
70648
  function staticVariableDefinition(name, type, defaultValue, variableName) {
70740
70649
  return {
70741
- kind: graphql12.Kind.VARIABLE_DEFINITION,
70650
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
70742
70651
  type: {
70743
- kind: graphql12.Kind.NAMED_TYPE,
70652
+ kind: graphql13.Kind.NAMED_TYPE,
70744
70653
  name: {
70745
- kind: graphql12.Kind.NAME,
70654
+ kind: graphql13.Kind.NAME,
70746
70655
  value: type
70747
70656
  }
70748
70657
  },
70749
70658
  variable: {
70750
- kind: graphql12.Kind.VARIABLE,
70659
+ kind: graphql13.Kind.VARIABLE,
70751
70660
  name: {
70752
- kind: graphql12.Kind.NAME,
70661
+ kind: graphql13.Kind.NAME,
70753
70662
  value: variableName ?? name
70754
70663
  }
70755
70664
  },
@@ -70761,9 +70670,9 @@ function staticVariableDefinition(name, type, defaultValue, variableName) {
70761
70670
  }
70762
70671
  function argumentNode(name, value) {
70763
70672
  return {
70764
- kind: graphql12.Kind.ARGUMENT,
70673
+ kind: graphql13.Kind.ARGUMENT,
70765
70674
  name: {
70766
- kind: graphql12.Kind.NAME,
70675
+ kind: graphql13.Kind.NAME,
70767
70676
  value: name
70768
70677
  },
70769
70678
  value: objectNode(value)
@@ -70771,16 +70680,16 @@ function argumentNode(name, value) {
70771
70680
  }
70772
70681
  function objectNode([type, defaultValue]) {
70773
70682
  const node = {
70774
- kind: graphql12.Kind.OBJECT,
70683
+ kind: graphql13.Kind.OBJECT,
70775
70684
  fields: [
70776
70685
  {
70777
- kind: graphql12.Kind.OBJECT_FIELD,
70686
+ kind: graphql13.Kind.OBJECT_FIELD,
70778
70687
  name: {
70779
- kind: graphql12.Kind.NAME,
70688
+ kind: graphql13.Kind.NAME,
70780
70689
  value: "type"
70781
70690
  },
70782
70691
  value: {
70783
- kind: graphql12.Kind.STRING,
70692
+ kind: graphql13.Kind.STRING,
70784
70693
  value: type
70785
70694
  }
70786
70695
  }
@@ -70788,8 +70697,8 @@ function objectNode([type, defaultValue]) {
70788
70697
  };
70789
70698
  if (defaultValue) {
70790
70699
  node.fields.push({
70791
- kind: graphql12.Kind.OBJECT_FIELD,
70792
- name: { kind: graphql12.Kind.NAME, value: "default" },
70700
+ kind: graphql13.Kind.OBJECT_FIELD,
70701
+ name: { kind: graphql13.Kind.NAME, value: "default" },
70793
70702
  value: {
70794
70703
  kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
70795
70704
  value: defaultValue.toString()
@@ -70800,34 +70709,34 @@ function objectNode([type, defaultValue]) {
70800
70709
  }
70801
70710
  var pageInfoSelection = [
70802
70711
  {
70803
- kind: graphql12.Kind.FIELD,
70712
+ kind: graphql13.Kind.FIELD,
70804
70713
  name: {
70805
- kind: graphql12.Kind.NAME,
70714
+ kind: graphql13.Kind.NAME,
70806
70715
  value: "edges"
70807
70716
  },
70808
70717
  selectionSet: {
70809
- kind: graphql12.Kind.SELECTION_SET,
70718
+ kind: graphql13.Kind.SELECTION_SET,
70810
70719
  selections: [
70811
70720
  {
70812
- kind: graphql12.Kind.FIELD,
70721
+ kind: graphql13.Kind.FIELD,
70813
70722
  name: {
70814
- kind: graphql12.Kind.NAME,
70723
+ kind: graphql13.Kind.NAME,
70815
70724
  value: "cursor"
70816
70725
  }
70817
70726
  },
70818
70727
  {
70819
- kind: graphql12.Kind.FIELD,
70728
+ kind: graphql13.Kind.FIELD,
70820
70729
  name: {
70821
- kind: graphql12.Kind.NAME,
70730
+ kind: graphql13.Kind.NAME,
70822
70731
  value: "node"
70823
70732
  },
70824
70733
  selectionSet: {
70825
- kind: graphql12.Kind.SELECTION_SET,
70734
+ kind: graphql13.Kind.SELECTION_SET,
70826
70735
  selections: [
70827
70736
  {
70828
- kind: graphql12.Kind.FIELD,
70737
+ kind: graphql13.Kind.FIELD,
70829
70738
  name: {
70830
- kind: graphql12.Kind.NAME,
70739
+ kind: graphql13.Kind.NAME,
70831
70740
  value: "__typename"
70832
70741
  }
70833
70742
  }
@@ -70838,39 +70747,39 @@ var pageInfoSelection = [
70838
70747
  }
70839
70748
  },
70840
70749
  {
70841
- kind: graphql12.Kind.FIELD,
70750
+ kind: graphql13.Kind.FIELD,
70842
70751
  name: {
70843
- kind: graphql12.Kind.NAME,
70752
+ kind: graphql13.Kind.NAME,
70844
70753
  value: "pageInfo"
70845
70754
  },
70846
70755
  selectionSet: {
70847
- kind: graphql12.Kind.SELECTION_SET,
70756
+ kind: graphql13.Kind.SELECTION_SET,
70848
70757
  selections: [
70849
70758
  {
70850
- kind: graphql12.Kind.FIELD,
70759
+ kind: graphql13.Kind.FIELD,
70851
70760
  name: {
70852
- kind: graphql12.Kind.NAME,
70761
+ kind: graphql13.Kind.NAME,
70853
70762
  value: "hasPreviousPage"
70854
70763
  }
70855
70764
  },
70856
70765
  {
70857
- kind: graphql12.Kind.FIELD,
70766
+ kind: graphql13.Kind.FIELD,
70858
70767
  name: {
70859
- kind: graphql12.Kind.NAME,
70768
+ kind: graphql13.Kind.NAME,
70860
70769
  value: "hasNextPage"
70861
70770
  }
70862
70771
  },
70863
70772
  {
70864
- kind: graphql12.Kind.FIELD,
70773
+ kind: graphql13.Kind.FIELD,
70865
70774
  name: {
70866
- kind: graphql12.Kind.NAME,
70775
+ kind: graphql13.Kind.NAME,
70867
70776
  value: "startCursor"
70868
70777
  }
70869
70778
  },
70870
70779
  {
70871
- kind: graphql12.Kind.FIELD,
70780
+ kind: graphql13.Kind.FIELD,
70872
70781
  name: {
70873
- kind: graphql12.Kind.NAME,
70782
+ kind: graphql13.Kind.NAME,
70874
70783
  value: "endCursor"
70875
70784
  }
70876
70785
  }
@@ -70884,17 +70793,17 @@ async function addListFragments(config, documents) {
70884
70793
  const lists = {};
70885
70794
  const errors = [];
70886
70795
  for (const doc of documents) {
70887
- doc.document = graphql13.visit(doc.document, {
70796
+ doc.document = graphql14.visit(doc.document, {
70888
70797
  Directive(node, key, parent2, path3, ancestors) {
70889
70798
  if ([config.listDirective, config.paginateDirective].includes(node.name.value)) {
70890
70799
  const nameArg = node.arguments?.find(
70891
70800
  (arg) => arg.name.value === config.listOrPaginateNameArg
70892
70801
  );
70893
70802
  let error = {
70894
- ...new graphql13.GraphQLError(
70803
+ ...new graphql14.GraphQLError(
70895
70804
  "",
70896
70805
  node,
70897
- new graphql13.Source(""),
70806
+ new graphql14.Source(""),
70898
70807
  node.loc ? [node.loc.start, node.loc.end] : null,
70899
70808
  path3
70900
70809
  ),
@@ -70946,7 +70855,7 @@ async function addListFragments(config, documents) {
70946
70855
  {
70947
70856
  kind: "Argument",
70948
70857
  name: {
70949
- kind: graphql13.Kind.NAME,
70858
+ kind: graphql14.Kind.NAME,
70950
70859
  value: "connection"
70951
70860
  },
70952
70861
  value: {
@@ -70996,7 +70905,7 @@ async function addListFragments(config, documents) {
70996
70905
  const validDeletes = [
70997
70906
  ...new Set(
70998
70907
  Object.values(lists).map(({ type }) => {
70999
- if (!(type instanceof graphql13.GraphQLObjectType)) {
70908
+ if (!(type instanceof graphql14.GraphQLObjectType)) {
71000
70909
  return "";
71001
70910
  }
71002
70911
  if (config.keyFieldsForType(type.name).length !== 1) {
@@ -71010,7 +70919,7 @@ async function addListFragments(config, documents) {
71010
70919
  return;
71011
70920
  }
71012
70921
  const generatedDoc = {
71013
- kind: graphql13.Kind.DOCUMENT,
70922
+ kind: graphql14.Kind.DOCUMENT,
71014
70923
  definitions: Object.entries(lists).flatMap(
71015
70924
  ([name, { selection, type }]) => {
71016
70925
  const schemaType = config.schema.getType(type.name);
@@ -71018,7 +70927,7 @@ async function addListFragments(config, documents) {
71018
70927
  throw new HoudiniError({ message: "Lists must have a selection" });
71019
70928
  }
71020
70929
  const fragmentSelection = {
71021
- kind: graphql13.Kind.SELECTION_SET,
70930
+ kind: graphql14.Kind.SELECTION_SET,
71022
70931
  selections: [...selection.selections]
71023
70932
  };
71024
70933
  if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
@@ -71033,14 +70942,14 @@ async function addListFragments(config, documents) {
71033
70942
  {
71034
70943
  name: {
71035
70944
  value: config.listInsertFragment(name),
71036
- kind: graphql13.Kind.NAME
70945
+ kind: graphql14.Kind.NAME
71037
70946
  },
71038
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
70947
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
71039
70948
  selectionSet: fragmentSelection,
71040
70949
  typeCondition: {
71041
- kind: graphql13.Kind.NAMED_TYPE,
70950
+ kind: graphql14.Kind.NAMED_TYPE,
71042
70951
  name: {
71043
- kind: graphql13.Kind.NAME,
70952
+ kind: graphql14.Kind.NAME,
71044
70953
  value: type.name
71045
70954
  }
71046
70955
  }
@@ -71048,32 +70957,32 @@ async function addListFragments(config, documents) {
71048
70957
  {
71049
70958
  name: {
71050
70959
  value: config.listToggleFragment(name),
71051
- kind: graphql13.Kind.NAME
70960
+ kind: graphql14.Kind.NAME
71052
70961
  },
71053
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
70962
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
71054
70963
  selectionSet: fragmentSelection,
71055
70964
  typeCondition: {
71056
- kind: graphql13.Kind.NAMED_TYPE,
70965
+ kind: graphql14.Kind.NAMED_TYPE,
71057
70966
  name: {
71058
- kind: graphql13.Kind.NAME,
70967
+ kind: graphql14.Kind.NAME,
71059
70968
  value: type.name
71060
70969
  }
71061
70970
  }
71062
70971
  },
71063
70972
  {
71064
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
70973
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
71065
70974
  name: {
71066
70975
  value: config.listRemoveFragment(name),
71067
- kind: graphql13.Kind.NAME
70976
+ kind: graphql14.Kind.NAME
71068
70977
  },
71069
70978
  selectionSet: {
71070
- kind: graphql13.Kind.SELECTION_SET,
70979
+ kind: graphql14.Kind.SELECTION_SET,
71071
70980
  selections: [...objectIdentificationSelection(config, type)]
71072
70981
  },
71073
70982
  typeCondition: {
71074
- kind: graphql13.Kind.NAMED_TYPE,
70983
+ kind: graphql14.Kind.NAMED_TYPE,
71075
70984
  name: {
71076
- kind: graphql13.Kind.NAME,
70985
+ kind: graphql14.Kind.NAME,
71077
70986
  value: type.name
71078
70987
  }
71079
70988
  }
@@ -71082,14 +70991,14 @@ async function addListFragments(config, documents) {
71082
70991
  }
71083
70992
  ).concat(
71084
70993
  ...validDeletes.map((typeName) => ({
71085
- kind: graphql13.Kind.DIRECTIVE_DEFINITION,
70994
+ kind: graphql14.Kind.DIRECTIVE_DEFINITION,
71086
70995
  name: {
71087
- kind: graphql13.Kind.NAME,
70996
+ kind: graphql14.Kind.NAME,
71088
70997
  value: config.listDeleteDirective(typeName)
71089
70998
  },
71090
70999
  locations: [
71091
71000
  {
71092
- kind: graphql13.Kind.NAME,
71001
+ kind: graphql14.Kind.NAME,
71093
71002
  value: "FIELD"
71094
71003
  }
71095
71004
  ],
@@ -71097,8 +71006,8 @@ async function addListFragments(config, documents) {
71097
71006
  }))
71098
71007
  )
71099
71008
  };
71100
- config.newSchema += "\n" + generatedDoc.definitions.filter((c2) => c2.kind !== "FragmentDefinition").map(graphql13.print).join("\n\n");
71101
- config.newDocuments += "\n" + generatedDoc.definitions.filter((c2) => c2.kind === "FragmentDefinition").map(graphql13.print).join("\n\n");
71009
+ config.newSchema += "\n" + generatedDoc.definitions.filter((c2) => c2.kind !== "FragmentDefinition").map(graphql14.print).join("\n\n");
71010
+ config.newDocuments += "\n" + generatedDoc.definitions.filter((c2) => c2.kind === "FragmentDefinition").map(graphql14.print).join("\n\n");
71102
71011
  documents.push({
71103
71012
  name: "generated::lists",
71104
71013
  kind: ArtifactKind.Fragment,
@@ -71184,11 +71093,11 @@ var nodeNotDefinedMessage = (config) => `Looks like you are trying to use the ${
71184
71093
  For more information, visit this link: ${siteURL}/guides/pagination`;
71185
71094
 
71186
71095
  // src/codegen/generators/artifacts/fieldKey.ts
71187
- import * as graphql14 from "graphql";
71096
+ import * as graphql15 from "graphql";
71188
71097
  function fieldKey(config, field) {
71189
71098
  const attributeName = field.alias?.value || field.name.value;
71190
- const printed = graphql14.print(field);
71191
- const secondParse = graphql14.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
71099
+ const printed = graphql15.print(field);
71100
+ const secondParse = graphql15.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
71192
71101
  let paginateMode = config.defaultPaginateMode;
71193
71102
  const paginatedDirective = field.directives?.find(
71194
71103
  (directive) => directive.name.value === config.paginateDirective
@@ -71311,13 +71220,13 @@ function prepareSelection({
71311
71220
  } else if ("getFields" in type) {
71312
71221
  let typeRef = type.getFields()[field.name.value].type;
71313
71222
  fieldType = getRootType(typeRef);
71314
- nullable = !graphql15.isNonNullType(typeRef);
71315
- } else if (graphql15.isAbstractType(type)) {
71223
+ nullable = !graphql16.isNonNullType(typeRef);
71224
+ } else if (graphql16.isAbstractType(type)) {
71316
71225
  for (const possible of config.schema.getPossibleTypes(type)) {
71317
- if (graphql15.isObjectType(possible)) {
71226
+ if (graphql16.isObjectType(possible)) {
71318
71227
  if (possible.getFields()[field.name.value]) {
71319
71228
  fieldType = possible.getFields()[field.name.value].type;
71320
- nullable = !graphql15.isNonNullType(fieldType);
71229
+ nullable = !graphql16.isNonNullType(fieldType);
71321
71230
  break;
71322
71231
  }
71323
71232
  }
@@ -71454,7 +71363,7 @@ function prepareSelection({
71454
71363
  kind: "value"
71455
71364
  } : { kind: "continue" };
71456
71365
  const parentType = config.schema.getType(rootType);
71457
- if (graphql15.isObjectType(parentType) || graphql15.isInterfaceType(parentType)) {
71366
+ if (graphql16.isObjectType(parentType) || graphql16.isInterfaceType(parentType)) {
71458
71367
  const fieldType2 = parentType.getFields()[field.name.value]?.type;
71459
71368
  if (fieldType2) {
71460
71369
  const listCount = unwrapType(config, fieldType2).wrappers.filter(
@@ -71477,7 +71386,7 @@ function prepareSelection({
71477
71386
  }
71478
71387
  fieldObj.loading = loadingValue;
71479
71388
  }
71480
- if (graphql15.isInterfaceType(fieldType) || graphql15.isUnionType(fieldType)) {
71389
+ if (graphql16.isInterfaceType(fieldType) || graphql16.isUnionType(fieldType)) {
71481
71390
  fieldObj.abstract = true;
71482
71391
  if (Object.values(fieldObj.selection?.abstractFields?.fields ?? {}).some(
71483
71392
  (fields) => Object.values(fields ?? {}).some((field2) => field2.required)
@@ -71559,7 +71468,7 @@ function mergeSelection({
71559
71468
  typeSelection,
71560
71469
  abstractSelection.fields[typeName] ?? {}
71561
71470
  );
71562
- if (graphql15.isAbstractType(gqlType)) {
71471
+ if (graphql16.isAbstractType(gqlType)) {
71563
71472
  for (const possible of config.schema.getPossibleTypes(gqlType)) {
71564
71473
  if (!possibleSelectionTypes[typeName]) {
71565
71474
  possibleSelectionTypes[typeName] = [];
@@ -71594,7 +71503,7 @@ function mergeSelection({
71594
71503
  }
71595
71504
  }
71596
71505
  const parentType = config.schema.getType(rootType);
71597
- const possibleParents = graphql15.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t3) => t3.name) : [parentType.name];
71506
+ const possibleParents = graphql16.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t3) => t3.name) : [parentType.name];
71598
71507
  for (const key of Object.keys(abstractSelection.typeMap)) {
71599
71508
  if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
71600
71509
  delete abstractSelection.typeMap[key];
@@ -71651,12 +71560,12 @@ function mergeSelection({
71651
71560
  }
71652
71561
 
71653
71562
  // src/codegen/generators/artifacts/index.ts
71654
- var AST4 = recast4.types.builders;
71563
+ var AST5 = recast5.types.builders;
71655
71564
  function artifactGenerator(stats) {
71656
71565
  return async function(config, docs) {
71657
71566
  const filterTypes = {};
71658
71567
  for (const doc of docs) {
71659
- graphql16.visit(doc.document, {
71568
+ graphql17.visit(doc.document, {
71660
71569
  Directive(node, _3, __, ___, ancestors) {
71661
71570
  if (node.name.value !== config.listDirective) {
71662
71571
  return;
@@ -71716,7 +71625,7 @@ function artifactGenerator(stats) {
71716
71625
  return;
71717
71626
  }
71718
71627
  const usedVariableNames = /* @__PURE__ */ new Set();
71719
- let documentWithoutInternalDirectives = graphql16.visit(document, {
71628
+ let documentWithoutInternalDirectives = graphql17.visit(document, {
71720
71629
  Directive(node) {
71721
71630
  if (config.isInternalDirective(node.name.value)) {
71722
71631
  return null;
@@ -71729,7 +71638,7 @@ function artifactGenerator(stats) {
71729
71638
  }
71730
71639
  }
71731
71640
  });
71732
- let documentWithoutExtraVariables = graphql16.visit(
71641
+ let documentWithoutExtraVariables = graphql17.visit(
71733
71642
  documentWithoutInternalDirectives,
71734
71643
  {
71735
71644
  VariableDefinition(variableDefinitionNode) {
@@ -71740,13 +71649,13 @@ function artifactGenerator(stats) {
71740
71649
  }
71741
71650
  }
71742
71651
  );
71743
- let rawString = graphql16.print(documentWithoutExtraVariables);
71652
+ let rawString = graphql17.print(documentWithoutExtraVariables);
71744
71653
  let docKind = doc.kind;
71745
71654
  const operations = document.definitions.filter(
71746
- ({ kind }) => kind === graphql16.Kind.OPERATION_DEFINITION
71655
+ ({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
71747
71656
  );
71748
71657
  const fragments = document.definitions.filter(
71749
- ({ kind }) => kind === graphql16.Kind.FRAGMENT_DEFINITION
71658
+ ({ kind }) => kind === graphql17.Kind.FRAGMENT_DEFINITION
71750
71659
  );
71751
71660
  let rootType = "";
71752
71661
  let selectionSet;
@@ -71946,9 +71855,9 @@ function artifactGenerator(stats) {
71946
71855
  plugin2.artifactEnd({ config, document: doc });
71947
71856
  }
71948
71857
  const _houdiniHash = hashOriginal({ document: doc });
71949
- const file = AST4.program([
71858
+ const file = AST5.program([
71950
71859
  moduleExport(config, "default", serializeValue(artifact)),
71951
- AST4.expressionStatement(AST4.stringLiteral(`HoudiniHash=${_houdiniHash}`))
71860
+ AST5.expressionStatement(AST5.stringLiteral(`HoudiniHash=${_houdiniHash}`))
71952
71861
  ]);
71953
71862
  const artifactPath = config.artifactPath(document);
71954
71863
  const countDocument = doc.generateStore;
@@ -72006,7 +71915,7 @@ function applyMask(config, target, mask) {
72006
71915
  if (!targetType) {
72007
71916
  continue;
72008
71917
  }
72009
- if (graphql16.isAbstractType(targetType)) {
71918
+ if (graphql17.isAbstractType(targetType)) {
72010
71919
  for (const possible of config.schema.getPossibleTypes(targetType)) {
72011
71920
  if (target.abstractFields?.fields[possible.name]) {
72012
71921
  applyMask(
@@ -72029,8 +71938,8 @@ function applyMask(config, target, mask) {
72029
71938
  }
72030
71939
 
72031
71940
  // src/codegen/generators/runtime/graphqlFunction.ts
72032
- var recast5 = __toESM(require_main2(), 1);
72033
- var AST5 = recast5.types.builders;
71941
+ var recast6 = __toESM(require_main2(), 1);
71942
+ var AST6 = recast6.types.builders;
72034
71943
  async function generateGraphqlReturnTypes(config, docs) {
72035
71944
  const indexPath = path_exports.join(config.runtimeDirectory, "index.d.ts");
72036
71945
  const fileContent = await fs_exports.readFile(indexPath) || "";
@@ -72065,18 +71974,18 @@ async function generateGraphqlReturnTypes(config, docs) {
72065
71974
  continue;
72066
71975
  }
72067
71976
  for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
72068
- const input = AST5.identifier("str");
72069
- input.typeAnnotation = AST5.tsTypeAnnotation(
72070
- AST5.tsLiteralType(AST5.stringLiteral(queryString))
71977
+ const input = AST6.identifier("str");
71978
+ input.typeAnnotation = AST6.tsTypeAnnotation(
71979
+ AST6.tsLiteralType(AST6.stringLiteral(queryString))
72071
71980
  );
72072
71981
  script.body.splice(
72073
71982
  i2,
72074
71983
  0,
72075
- AST5.exportNamedDeclaration(
72076
- AST5.tsDeclareFunction(
72077
- AST5.identifier("graphql"),
71984
+ AST6.exportNamedDeclaration(
71985
+ AST6.tsDeclareFunction(
71986
+ AST6.identifier("graphql"),
72078
71987
  [input],
72079
- AST5.tsTypeAnnotation(AST5.tsTypeReference(AST5.identifier(returnValue)))
71988
+ AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
72080
71989
  )
72081
71990
  )
72082
71991
  );
@@ -72251,165 +72160,22 @@ function moduleStatments(config) {
72251
72160
  var recast11 = __toESM(require_main2(), 1);
72252
72161
 
72253
72162
  // src/codegen/generators/typescript/addReferencedInputTypes.ts
72254
- var recast8 = __toESM(require_main2(), 1);
72255
- import * as graphql19 from "graphql";
72256
-
72257
- // src/codegen/generators/typescript/typeReference.ts
72258
72163
  var recast7 = __toESM(require_main2(), 1);
72259
72164
  import * as graphql18 from "graphql";
72260
-
72261
- // src/codegen/generators/typescript/types.ts
72262
- var recast6 = __toESM(require_main2(), 1);
72263
- import * as graphql17 from "graphql";
72264
- var AST6 = recast6.types.builders;
72265
- function readonlyProperty(prop, enable = true) {
72266
- if (enable) {
72267
- prop.readonly = true;
72268
- }
72269
- return prop;
72270
- }
72271
- function nullableField(inner, input = false) {
72272
- const members = [inner, AST6.tsNullKeyword()];
72273
- if (input) {
72274
- members.push(AST6.tsUndefinedKeyword());
72275
- }
72276
- return AST6.tsUnionType(members);
72277
- }
72278
- function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
72279
- if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
72280
- if (!field) {
72281
- return AST6.tsNeverKeyword();
72282
- }
72283
- const component = config.componentFields[field.parent][field.field];
72284
- const sourcePathRelative = path_exports.relative(
72285
- path_exports.join(config.projectRoot, "src"),
72286
- component.filepath
72287
- );
72288
- let sourcePathParsed = path_exports.parse(sourcePathRelative);
72289
- let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
72290
- const localImport = ensureImports({
72291
- config,
72292
- body,
72293
- import: "__component__" + component.fragment,
72294
- sourceModule: path_exports.join(
72295
- path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
72296
- "src",
72297
- sourcePath
72298
- )
72299
- });
72300
- const parameters = AST6.tsTypeReference(AST6.identifier("Parameters"));
72301
- parameters.typeParameters = AST6.tsTypeParameterInstantiation([
72302
- AST6.tsTypeQuery(AST6.identifier(localImport))
72303
- ]);
72304
- const indexed = AST6.tsIndexedAccessType(
72305
- parameters,
72306
- AST6.tsLiteralType(AST6.numericLiteral(0))
72307
- );
72308
- const omit = AST6.tsTypeReference(AST6.identifier("Omit"));
72309
- omit.typeParameters = AST6.tsTypeParameterInstantiation([
72310
- indexed,
72311
- AST6.tsLiteralType(AST6.stringLiteral(component.prop))
72312
- ]);
72313
- const arg = AST6.identifier("props");
72314
- arg.typeAnnotation = AST6.tsTypeAnnotation(omit);
72315
- const returnType = AST6.tsTypeReference(AST6.identifier("ReturnType"));
72316
- returnType.typeParameters = AST6.tsTypeParameterInstantiation([
72317
- AST6.tsTypeQuery(AST6.identifier(localImport))
72318
- ]);
72319
- const fnType = AST6.tsFunctionType([arg]);
72320
- fnType.typeAnnotation = AST6.tsTypeAnnotation(returnType);
72321
- return fnType;
72322
- }
72323
- switch (target.name) {
72324
- case "String": {
72325
- return AST6.tsStringKeyword();
72326
- }
72327
- case "Int": {
72328
- return AST6.tsNumberKeyword();
72329
- }
72330
- case "Float": {
72331
- return AST6.tsNumberKeyword();
72332
- }
72333
- case "Boolean": {
72334
- return AST6.tsBooleanKeyword();
72335
- }
72336
- case "ID": {
72337
- return AST6.tsStringKeyword();
72338
- }
72339
- default: {
72340
- if (graphql17.isNonNullType(target) && "ofType" in target) {
72341
- return scalarPropertyValue(
72342
- config,
72343
- filepath,
72344
- missingScalars,
72345
- target.ofType,
72346
- body,
72347
- field
72348
- );
72349
- }
72350
- if (config.scalars?.[target.name]) {
72351
- return AST6.tsTypeReference(AST6.identifier(config.scalars?.[target.name].type));
72352
- }
72353
- if (target.name !== config.componentScalar) {
72354
- missingScalars.add(target.name);
72355
- }
72356
- return AST6.tsAnyKeyword();
72357
- }
72358
- }
72359
- }
72360
-
72361
- // src/codegen/generators/typescript/typeReference.ts
72362
72165
  var AST7 = recast7.types.builders;
72363
- function tsTypeReference(config, filepath, missingScalars, definition, body) {
72364
- const { type, wrappers } = unwrapType(config, definition.type);
72365
- let result;
72366
- if (graphql18.isScalarType(type)) {
72367
- result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
72368
- } else if (graphql18.isEnumType(type)) {
72369
- result = enumReference(config, body, type.name);
72370
- } else {
72371
- result = AST7.tsTypeReference(AST7.identifier(type.name));
72372
- }
72373
- for (const toWrap of wrappers) {
72374
- if (toWrap === "NonNull" /* NonNull */) {
72375
- continue;
72376
- } else if (toWrap === "Nullable" /* Nullable */) {
72377
- result = nullableField(result, true);
72378
- } else if (toWrap === "List" /* List */) {
72379
- result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
72380
- }
72381
- }
72382
- return result;
72383
- }
72384
- function enumReference(config, body, name) {
72385
- ensureImports({
72386
- config,
72387
- body,
72388
- import: ["ValueOf"],
72389
- importKind: "type",
72390
- sourceModule: "$houdini/runtime/lib/types"
72391
- });
72392
- return AST7.tsTypeReference(
72393
- AST7.identifier("ValueOf"),
72394
- AST7.tsTypeParameterInstantiation([AST7.tsTypeQuery(AST7.identifier(name))])
72395
- );
72396
- }
72397
-
72398
- // src/codegen/generators/typescript/addReferencedInputTypes.ts
72399
- var AST8 = recast8.types.builders;
72400
72166
  function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
72401
72167
  const { type } = unwrapType(config, rootType);
72402
- if (graphql19.isScalarType(type)) {
72168
+ if (graphql18.isScalarType(type)) {
72403
72169
  return;
72404
72170
  }
72405
72171
  if (visitedTypes.has(type.name)) {
72406
72172
  return;
72407
72173
  }
72408
- if (graphql19.isUnionType(type)) {
72174
+ if (graphql18.isUnionType(type)) {
72409
72175
  throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
72410
72176
  }
72411
72177
  visitedTypes.add(type.name);
72412
- if (graphql19.isEnumType(type)) {
72178
+ if (graphql18.isEnumType(type)) {
72413
72179
  ensureImports({
72414
72180
  config,
72415
72181
  body,
@@ -72423,21 +72189,37 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
72423
72189
  for (const field of Object.values(type.getFields())) {
72424
72190
  addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
72425
72191
  members.push(
72426
- AST8.tsPropertySignature(
72427
- AST8.identifier(field.name),
72428
- AST8.tsTypeAnnotation(
72192
+ AST7.tsPropertySignature(
72193
+ AST7.identifier(field.name),
72194
+ AST7.tsTypeAnnotation(
72429
72195
  tsTypeReference(config, filepath, missingScalars, field, body)
72430
72196
  ),
72431
- graphql19.isNullableType(field.type)
72197
+ graphql18.isNullableType(field.type)
72432
72198
  )
72433
72199
  );
72434
72200
  }
72435
- body.push(AST8.tsTypeAliasDeclaration(AST8.identifier(type.name), AST8.tsTypeLiteral(members)));
72201
+ body.push(AST7.tsTypeAliasDeclaration(AST7.identifier(type.name), AST7.tsTypeLiteral(members)));
72436
72202
  }
72437
72203
 
72438
72204
  // src/codegen/generators/typescript/inlineType.ts
72439
72205
  var recast9 = __toESM(require_main2(), 1);
72440
- import * as graphql20 from "graphql";
72206
+ import * as graphql19 from "graphql";
72207
+
72208
+ // src/codegen/generators/comments/jsdoc.ts
72209
+ var recast8 = __toESM(require_main2(), 1);
72210
+ var AST8 = recast8.types.builders;
72211
+ function jsdocComment(text, deprecated) {
72212
+ let commentContent = `*
72213
+ * ${text}
72214
+ `;
72215
+ if (deprecated) {
72216
+ commentContent = `${commentContent} * @deprecated ${deprecated}
72217
+ `;
72218
+ }
72219
+ return AST8.commentBlock(commentContent, true);
72220
+ }
72221
+
72222
+ // src/codegen/generators/typescript/inlineType.ts
72441
72223
  var AST9 = recast9.types.builders;
72442
72224
  var fragmentKey2 = " $fragments";
72443
72225
  function inlineType({
@@ -72458,7 +72240,7 @@ function inlineType({
72458
72240
  const { type, wrappers } = unwrapType(config, rootType);
72459
72241
  let result;
72460
72242
  let forceNullable = false;
72461
- if (graphql20.isScalarType(type)) {
72243
+ if (graphql19.isScalarType(type)) {
72462
72244
  result = scalarPropertyValue(
72463
72245
  config,
72464
72246
  filepath,
@@ -72467,7 +72249,7 @@ function inlineType({
72467
72249
  body,
72468
72250
  field
72469
72251
  );
72470
- } else if (graphql20.isEnumType(type)) {
72252
+ } else if (graphql19.isEnumType(type)) {
72471
72253
  ensureImports({
72472
72254
  config,
72473
72255
  body,
@@ -72492,11 +72274,11 @@ function inlineType({
72492
72274
  for (const selection of selections) {
72493
72275
  if (selection.kind === "InlineFragment" && selection.typeCondition) {
72494
72276
  const fragmentType = config.schema.getType(selection.typeCondition.name.value);
72495
- if (!graphql20.isInterfaceType(type) && !graphql20.isUnionType(type)) {
72277
+ if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
72496
72278
  selectedFields.push(...selection.selectionSet.selections);
72497
72279
  continue;
72498
72280
  }
72499
- if (!graphql20.isInterfaceType(fragmentType) && !graphql20.isUnionType(fragmentType)) {
72281
+ if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
72500
72282
  if (!inlineFragments[fragmentType.name]) {
72501
72283
  inlineFragments[fragmentType.name] = [];
72502
72284
  }
@@ -72588,6 +72370,11 @@ function inlineType({
72588
72370
  if (allOptional) {
72589
72371
  prop.optional = true;
72590
72372
  }
72373
+ if (field2.description || field2.deprecationReason) {
72374
+ prop.comments = [
72375
+ jsdocComment(field2.description ?? "", field2.deprecationReason ?? void 0)
72376
+ ];
72377
+ }
72591
72378
  return prop;
72592
72379
  })
72593
72380
  ]);
@@ -72639,7 +72426,7 @@ function inlineType({
72639
72426
  }
72640
72427
  }
72641
72428
  }
72642
- if (objectType.type === "TSTypeLiteral" && !graphql20.isInterfaceType(fragmentRootType) && !graphql20.isUnionType(fragmentRootType)) {
72429
+ if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
72643
72430
  const existingTypenameIndex = objectType.members.findIndex(
72644
72431
  (member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
72645
72432
  );
@@ -72664,11 +72451,11 @@ function inlineType({
72664
72451
  ];
72665
72452
  }
72666
72453
  let coveredTypenames;
72667
- if (graphql20.isInterfaceType(fragmentRootType)) {
72454
+ if (graphql19.isInterfaceType(fragmentRootType)) {
72668
72455
  coveredTypenames = interfaceCoveredTypenames(fragmentRootType);
72669
- } else if (graphql20.isUnionType(fragmentRootType)) {
72456
+ } else if (graphql19.isUnionType(fragmentRootType)) {
72670
72457
  coveredTypenames = fragmentRootType.getTypes().map((type2) => type2.name);
72671
- } else if (graphql20.isObjectType(fragmentRootType)) {
72458
+ } else if (graphql19.isObjectType(fragmentRootType)) {
72672
72459
  coveredTypenames = [fragmentRootType.name];
72673
72460
  } else {
72674
72461
  throw Error("unreachable code");
@@ -72704,7 +72491,7 @@ function inlineType({
72704
72491
  );
72705
72492
  }
72706
72493
  );
72707
- const parentIsUnionOrInterface = !graphql20.isInterfaceType(type) && !graphql20.isUnionType(type);
72494
+ const parentIsUnionOrInterface = !graphql19.isInterfaceType(type) && !graphql19.isUnionType(type);
72708
72495
  const possibleTypenames = parentIsUnionOrInterface ? [parent.name] : config.schema.getPossibleTypes(type).map((type2) => type2.name);
72709
72496
  const coveredTypenames = new Set(
72710
72497
  Object.values(inlineFragmentSelections).flatMap((sel) => sel.coveredTypenames)
@@ -72771,7 +72558,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
72771
72558
  },
72772
72559
  type: schema.getType("String")
72773
72560
  };
72774
- } else if (graphql20.isNonNullType(rootType) && "getFields" in rootType.ofType) {
72561
+ } else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
72775
72562
  fields = rootType.ofType.getFields();
72776
72563
  } else {
72777
72564
  fields = rootType.getFields();
@@ -72783,7 +72570,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
72783
72570
  message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
72784
72571
  });
72785
72572
  }
72786
- const fieldType = graphql20.getNamedType(field.type);
72573
+ const fieldType = graphql19.getNamedType(field.type);
72787
72574
  if (!fieldType) {
72788
72575
  throw new HoudiniError({
72789
72576
  filepath,
@@ -73292,7 +73079,7 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
73292
73079
 
73293
73080
  // src/codegen/generators/typescript/imperativeTypeDef.ts
73294
73081
  var recast12 = __toESM(require_main2(), 1);
73295
- import * as graphql21 from "graphql";
73082
+ import * as graphql20 from "graphql";
73296
73083
  var AST12 = recast12.types.builders;
73297
73084
  async function imperativeCacheTypef(config, docs) {
73298
73085
  const returnType = (doc) => config.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
@@ -73343,7 +73130,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73343
73130
  const operationTypes = [config.schema.getMutationType(), config.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
73344
73131
  const visitedTypes = /* @__PURE__ */ new Set();
73345
73132
  const types16 = Object.values(config.schema.getTypeMap()).filter(
73346
- (type) => !graphql21.isAbstractType(type) && !graphql21.isScalarType(type) && !graphql21.isEnumType(type) && !graphql21.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
73133
+ (type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
73347
73134
  );
73348
73135
  const fragmentMap = fragmentListMap(
73349
73136
  config,
@@ -73360,7 +73147,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73360
73147
  }
73361
73148
  let idFields = AST12.tsNeverKeyword();
73362
73149
  const keys2 = keyFieldsForType(config.configFile, type.name);
73363
- if (graphql21.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
73150
+ if (graphql20.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
73364
73151
  idFields = AST12.tsTypeLiteral(
73365
73152
  keys2.map((key) => {
73366
73153
  const fieldType = type.getFields()[key];
@@ -73387,13 +73174,13 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73387
73174
  idFields = AST12.tsTypeLiteral([]);
73388
73175
  }
73389
73176
  let fields = AST12.tsTypeLiteral([]);
73390
- if (graphql21.isObjectType(type)) {
73177
+ if (graphql20.isObjectType(type)) {
73391
73178
  fields = AST12.tsTypeLiteral(
73392
73179
  Object.entries(type.getFields()).map(
73393
73180
  ([key, fieldType]) => {
73394
73181
  const unwrapped = unwrapType(config, fieldType.type);
73395
73182
  let typeOptions = AST12.tsUnionType([]);
73396
- if (graphql21.isScalarType(unwrapped.type)) {
73183
+ if (graphql20.isScalarType(unwrapped.type)) {
73397
73184
  typeOptions.types.push(
73398
73185
  scalarPropertyValue(
73399
73186
  config,
@@ -73407,11 +73194,11 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
73407
73194
  }
73408
73195
  )
73409
73196
  );
73410
- } else if (graphql21.isEnumType(unwrapped.type)) {
73197
+ } else if (graphql20.isEnumType(unwrapped.type)) {
73411
73198
  typeOptions.types.push(
73412
73199
  AST12.tsTypeReference(AST12.identifier(unwrapped.type.name))
73413
73200
  );
73414
- } else if (!graphql21.isAbstractType(unwrapped.type)) {
73201
+ } else if (!graphql20.isAbstractType(unwrapped.type)) {
73415
73202
  typeOptions.types.push(record(unwrapped.type.name));
73416
73203
  } else {
73417
73204
  typeOptions.types.push(
@@ -73507,7 +73294,7 @@ function listDefinitions(config, filepath, body, docs) {
73507
73294
  const lists = [];
73508
73295
  const visitedLists = /* @__PURE__ */ new Set();
73509
73296
  for (const doc of docs) {
73510
- graphql21.visit(doc.document, {
73297
+ graphql20.visit(doc.document, {
73511
73298
  Directive(node, key, parent2, path3, ancestors) {
73512
73299
  if (![config.listDirective, config.paginateDirective].includes(node.name.value)) {
73513
73300
  return;
@@ -73529,7 +73316,7 @@ function listDefinitions(config, filepath, body, docs) {
73529
73316
  const targetFieldDefinition = parentType.getFields()[targetField.name.value];
73530
73317
  const { type: listType } = unwrapType(config, targetFieldDefinition.type);
73531
73318
  const possibleTypes = [];
73532
- if (graphql21.isAbstractType(listType)) {
73319
+ if (graphql20.isAbstractType(listType)) {
73533
73320
  possibleTypes.push(
73534
73321
  ...config.schema.getPossibleTypes(listType).map((possible) => possible.name)
73535
73322
  );
@@ -73691,7 +73478,7 @@ async function typescriptGenerator(config, docs) {
73691
73478
  }
73692
73479
 
73693
73480
  // src/codegen/generators/persistedQueries/index.ts
73694
- import * as graphql22 from "graphql";
73481
+ import * as graphql21 from "graphql";
73695
73482
  async function persistOutputGenerator(config, docs) {
73696
73483
  if (!config.persistedQueriesPath.endsWith(".json")) {
73697
73484
  throw new Error('Can write Persisted Queries only in a ".json" file.');
@@ -73701,8 +73488,8 @@ async function persistOutputGenerator(config, docs) {
73701
73488
  if (!generateArtifact) {
73702
73489
  return acc;
73703
73490
  }
73704
- let rawString = graphql22.print(
73705
- graphql22.visit(document, {
73491
+ let rawString = graphql21.print(
73492
+ graphql21.visit(document, {
73706
73493
  Directive(node) {
73707
73494
  if (config.isInternalDirective(node.name.value)) {
73708
73495
  return null;
@@ -73711,7 +73498,7 @@ async function persistOutputGenerator(config, docs) {
73711
73498
  })
73712
73499
  );
73713
73500
  const operations = document.definitions.filter(
73714
- ({ kind }) => kind === graphql22.Kind.OPERATION_DEFINITION
73501
+ ({ kind }) => kind === graphql21.Kind.OPERATION_DEFINITION
73715
73502
  );
73716
73503
  if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
73717
73504
  if (artifact) {
@@ -73726,33 +73513,45 @@ async function persistOutputGenerator(config, docs) {
73726
73513
  }
73727
73514
 
73728
73515
  // src/codegen/generators/definitions/index.ts
73729
- import * as graphql24 from "graphql";
73516
+ import * as graphql23 from "graphql";
73730
73517
 
73731
73518
  // src/codegen/generators/definitions/enums.ts
73732
73519
  var recast13 = __toESM(require_main2(), 1);
73733
- import * as graphql23 from "graphql";
73520
+ import * as graphql22 from "graphql";
73734
73521
  var AST13 = recast13.types.builders;
73735
73522
  async function definitionsGenerator(config) {
73736
- const enums = graphql23.parse(graphql23.printSchema(config.schema)).definitions.filter(
73523
+ const enums = graphql22.parse(graphql22.printSchema(config.schema)).definitions.filter(
73737
73524
  (definition) => definition.kind === "EnumTypeDefinition"
73738
73525
  ).filter((def) => !config.isInternalEnum(def));
73739
73526
  const { code: runtimeDefinitions } = await printJS(
73740
73527
  AST13.program(
73741
73528
  enums.map((defn) => {
73742
73529
  const name = defn.name.value;
73743
- return moduleExport(
73530
+ const declaration = moduleExport(
73744
73531
  config,
73745
73532
  name,
73746
73533
  AST13.objectExpression(
73747
73534
  defn.values?.map((value) => {
73748
73535
  const str = value.name.value;
73749
- return AST13.objectProperty(
73536
+ const prop = AST13.objectProperty(
73750
73537
  AST13.stringLiteral(str),
73751
73538
  AST13.stringLiteral(str)
73752
73539
  );
73540
+ const deprecationReason = value.directives?.find((d3) => d3.name.value === "deprecated")?.arguments?.find((a2) => a2.name.value === "reason")?.value?.value;
73541
+ if (value.description || deprecationReason)
73542
+ prop.comments = [
73543
+ jsdocComment(value.description?.value ?? "", deprecationReason)
73544
+ ];
73545
+ return prop;
73753
73546
  }) || []
73754
73547
  )
73755
73548
  );
73549
+ if (defn.description) {
73550
+ declaration.comments = [
73551
+ AST13.commentBlock(`* ${defn.description.value} `, true, false)
73552
+ ];
73553
+ }
73554
+ return declaration;
73756
73555
  })
73757
73556
  )
73758
73557
  );
@@ -73761,11 +73560,19 @@ type ValuesOf<T> = T[keyof T]
73761
73560
  ` + enums.sort((a2, b2) => a2.name.value.localeCompare(b2.name.value)).map((definition) => {
73762
73561
  const name = definition.name.value;
73763
73562
  const values = definition.values;
73764
- return `
73563
+ let jsdoc = "";
73564
+ if (definition.description) {
73565
+ jsdoc = `
73566
+ /** ${definition.description.value} */`;
73567
+ }
73568
+ return `${jsdoc}
73765
73569
  export declare const ${name}: {
73766
- ${values?.map((value) => ` readonly ${value.name.value}: "${value.name.value}";`).join("\n")}
73570
+ ${values?.map(
73571
+ (value) => (value.description ? ` /** ${value.description.value} */
73572
+ ` : "") + ` readonly ${value.name.value}: "${value.name.value}";`
73573
+ ).join("\n")}
73767
73574
  }
73768
-
73575
+ ${jsdoc}
73769
73576
  export type ${name}$options = ValuesOf<typeof ${name}>
73770
73577
  `;
73771
73578
  }).join("");
@@ -73785,7 +73592,7 @@ async function schemaGenerator(config) {
73785
73592
  await Promise.all([
73786
73593
  fs_exports.writeFile(
73787
73594
  config.definitionsSchemaPath,
73788
- config.localSchema ? graphql24.printSchema(config.schema) : config.newSchema
73595
+ config.localSchema ? graphql23.printSchema(config.schema) : config.newSchema
73789
73596
  ),
73790
73597
  fs_exports.writeFile(config.definitionsDocumentsPath, config.newDocuments),
73791
73598
  definitionsGenerator(config)
@@ -75490,7 +75297,7 @@ function mergeGraphQLTypes2(typeSource, config) {
75490
75297
  }
75491
75298
 
75492
75299
  // src/codegen/transforms/schema.ts
75493
- import * as graphql25 from "graphql";
75300
+ import * as graphql24 from "graphql";
75494
75301
  async function graphqlExtensions(config, documents) {
75495
75302
  let internalSchema = `
75496
75303
  enum CachePolicy {
@@ -75613,7 +75420,7 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
75613
75420
  const args = fragmentArguments(config, "", field.parent);
75614
75421
  if (args.length > 0) {
75615
75422
  argString = "(" + args.map((arg) => {
75616
- const typeName = graphql25.print(arg.type);
75423
+ const typeName = graphql24.print(arg.type);
75617
75424
  return `${arg.name}:${typeName}${arg.required ? "!" : ""}`;
75618
75425
  }).join("\n") + ")";
75619
75426
  }
@@ -75623,20 +75430,20 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
75623
75430
  `;
75624
75431
  }).join("\n");
75625
75432
  extensions += `${Object.keys(config.configFile.features?.runtimeScalars ?? {}).map((scalar) => `scalar ${scalar}`).join("\n")}`;
75626
- config.newSchema = graphql25.print(mergeTypeDefs2([internalSchema, config.newSchema]));
75433
+ config.newSchema = graphql24.print(mergeTypeDefs2([internalSchema, config.newSchema]));
75627
75434
  config.schemaString += extensions;
75628
- config.schema = graphql25.buildSchema(
75629
- graphql25.print(
75630
- mergeTypeDefs2([graphql25.printSchema(config.schema), internalSchema, extensions])
75435
+ config.schema = graphql24.buildSchema(
75436
+ graphql24.print(
75437
+ mergeTypeDefs2([graphql24.printSchema(config.schema), internalSchema, extensions])
75631
75438
  )
75632
75439
  );
75633
75440
  }
75634
75441
 
75635
75442
  // src/codegen/transforms/typename.ts
75636
- import * as graphql26 from "graphql";
75443
+ import * as graphql25 from "graphql";
75637
75444
  async function addTypename(config, documents) {
75638
75445
  for (const doc of documents) {
75639
- doc.document = graphql26.visit(doc.document, {
75446
+ doc.document = graphql25.visit(doc.document, {
75640
75447
  Field(node, key, parent2, path3, ancestors) {
75641
75448
  if (!node.selectionSet) {
75642
75449
  return;
@@ -75648,7 +75455,7 @@ async function addTypename(config, documents) {
75648
75455
  );
75649
75456
  const field = type.getFields()[node.name.value];
75650
75457
  const fieldType = unwrapType(config, field.type).type;
75651
- if (graphql26.isInterfaceType(fieldType) || graphql26.isUnionType(fieldType)) {
75458
+ if (graphql25.isInterfaceType(fieldType) || graphql25.isUnionType(fieldType)) {
75652
75459
  return {
75653
75460
  ...node,
75654
75461
  selectionSet: {
@@ -75656,9 +75463,9 @@ async function addTypename(config, documents) {
75656
75463
  selections: [
75657
75464
  ...node.selectionSet.selections,
75658
75465
  {
75659
- kind: graphql26.Kind.FIELD,
75466
+ kind: graphql25.Kind.FIELD,
75660
75467
  name: {
75661
- kind: graphql26.Kind.NAME,
75468
+ kind: graphql25.Kind.NAME,
75662
75469
  value: "__typename"
75663
75470
  }
75664
75471
  }
@@ -75675,9 +75482,9 @@ async function addTypename(config, documents) {
75675
75482
  selections: [
75676
75483
  ...node.selectionSet.selections,
75677
75484
  {
75678
- kind: graphql26.Kind.FIELD,
75485
+ kind: graphql25.Kind.FIELD,
75679
75486
  name: {
75680
- kind: graphql26.Kind.NAME,
75487
+ kind: graphql25.Kind.NAME,
75681
75488
  value: "__typename"
75682
75489
  }
75683
75490
  }
@@ -75690,10 +75497,10 @@ async function addTypename(config, documents) {
75690
75497
  }
75691
75498
 
75692
75499
  // src/codegen/transforms/addID.ts
75693
- import * as graphql27 from "graphql";
75500
+ import * as graphql26 from "graphql";
75694
75501
  async function addID(config, documents) {
75695
75502
  for (const doc of documents) {
75696
- doc.document = graphql27.visit(doc.document, {
75503
+ doc.document = graphql26.visit(doc.document, {
75697
75504
  Field(node, key, parent2, path3, ancestors) {
75698
75505
  if (!node.selectionSet) {
75699
75506
  return;
@@ -75731,7 +75538,7 @@ function addKeysToSelection(config, node, fieldType) {
75731
75538
  if (!node.selectionSet || node.selectionSet.selections.length == 0) {
75732
75539
  return;
75733
75540
  }
75734
- if (!graphql27.isObjectType(fieldType) && !graphql27.isInterfaceType(fieldType)) {
75541
+ if (!graphql26.isObjectType(fieldType) && !graphql26.isInterfaceType(fieldType)) {
75735
75542
  return;
75736
75543
  }
75737
75544
  const keyFields = config.keyFieldsForType(fieldType.name);
@@ -75746,9 +75553,9 @@ function addKeysToSelection(config, node, fieldType) {
75746
75553
  continue;
75747
75554
  }
75748
75555
  selections.push({
75749
- kind: graphql27.Kind.FIELD,
75556
+ kind: graphql26.Kind.FIELD,
75750
75557
  name: {
75751
- kind: graphql27.Kind.NAME,
75558
+ kind: graphql26.Kind.NAME,
75752
75559
  value: keyField
75753
75560
  }
75754
75561
  });
@@ -75763,13 +75570,13 @@ function addKeysToSelection(config, node, fieldType) {
75763
75570
  }
75764
75571
 
75765
75572
  // src/codegen/transforms/componentFields.ts
75766
- import * as graphql28 from "graphql";
75573
+ import * as graphql27 from "graphql";
75767
75574
  async function componentFields(config, documents) {
75768
75575
  for (const document of documents) {
75769
- const typeInfo = new graphql28.TypeInfo(config.schema);
75770
- document.document = graphql28.visit(
75576
+ const typeInfo = new graphql27.TypeInfo(config.schema);
75577
+ document.document = graphql27.visit(
75771
75578
  document.document,
75772
- graphql28.visitWithTypeInfo(typeInfo, {
75579
+ graphql27.visitWithTypeInfo(typeInfo, {
75773
75580
  Field(node) {
75774
75581
  const parentType = typeInfo.getParentType();
75775
75582
  if (!parentType) {
@@ -75818,10 +75625,10 @@ async function componentFields(config, documents) {
75818
75625
  }
75819
75626
 
75820
75627
  // src/codegen/transforms/runtimeScalars.ts
75821
- import * as graphql29 from "graphql";
75628
+ import * as graphql28 from "graphql";
75822
75629
  async function addTypename2(config, documents) {
75823
75630
  for (const doc of documents) {
75824
- doc.document = graphql29.visit(doc.document, {
75631
+ doc.document = graphql28.visit(doc.document, {
75825
75632
  VariableDefinition(node) {
75826
75633
  const { type, wrappers } = unwrapType(config, node.type);
75827
75634
  const runtimeScalar = config.configFile.features?.runtimeScalars?.[type.name];
@@ -75860,7 +75667,7 @@ async function addTypename2(config, documents) {
75860
75667
  }
75861
75668
 
75862
75669
  // src/codegen/validators/typeCheck.ts
75863
- import * as graphql30 from "graphql";
75670
+ import * as graphql29 from "graphql";
75864
75671
  async function typeCheck(config, docs) {
75865
75672
  const errors = [];
75866
75673
  const freeLists = [];
@@ -75868,7 +75675,7 @@ async function typeCheck(config, docs) {
75868
75675
  const listTypes = [];
75869
75676
  const fragments = {};
75870
75677
  for (const { document: parsed, originalString, filename } of docs) {
75871
- graphql30.visit(parsed, {
75678
+ graphql29.visit(parsed, {
75872
75679
  FragmentDefinition(definition) {
75873
75680
  fragments[definition.name.value] = definition;
75874
75681
  },
@@ -75913,14 +75720,14 @@ async function typeCheck(config, docs) {
75913
75720
  );
75914
75721
  return;
75915
75722
  }
75916
- if (graphql30.isListType(rootType) || graphql30.isNonNullType(rootType) && graphql30.isListType(rootType.ofType)) {
75723
+ if (graphql29.isListType(rootType) || graphql29.isNonNullType(rootType) && graphql29.isListType(rootType.ofType)) {
75917
75724
  needsParent = true;
75918
75725
  break;
75919
75726
  }
75920
- if (graphql30.isNonNullType(rootType) && "ofType" in rootType) {
75727
+ if (graphql29.isNonNullType(rootType) && "ofType" in rootType) {
75921
75728
  rootType = rootType.ofType;
75922
75729
  }
75923
- if (graphql30.isScalarType(rootType)) {
75730
+ if (graphql29.isScalarType(rootType)) {
75924
75731
  break;
75925
75732
  }
75926
75733
  rootType = rootType?.getFields()[parent3.name.value]?.type;
@@ -75996,9 +75803,9 @@ async function typeCheck(config, docs) {
75996
75803
  );
75997
75804
  }
75998
75805
  let targetTypes = [type];
75999
- if (graphql30.isUnionType(type)) {
75806
+ if (graphql29.isUnionType(type)) {
76000
75807
  targetTypes = config.schema.getPossibleTypes(type);
76001
- } else if (graphql30.isInterfaceType(type)) {
75808
+ } else if (graphql29.isInterfaceType(type)) {
76002
75809
  try {
76003
75810
  for (const key of config.keyFieldsForType(type.name)) {
76004
75811
  if (!type.getFields()[key]) {
@@ -76034,13 +75841,13 @@ async function typeCheck(config, docs) {
76034
75841
  if (errors.length > 0) {
76035
75842
  throw errors;
76036
75843
  }
76037
- const rules = (filepath) => [...graphql30.specifiedRules].filter(
75844
+ const rules = (filepath) => [...graphql29.specifiedRules].filter(
76038
75845
  (rule) => ![
76039
- graphql30.NoUnusedFragmentsRule,
76040
- graphql30.KnownFragmentNamesRule,
76041
- graphql30.ExecutableDefinitionsRule,
76042
- graphql30.KnownDirectivesRule,
76043
- graphql30.KnownArgumentNamesRule
75846
+ graphql29.NoUnusedFragmentsRule,
75847
+ graphql29.KnownFragmentNamesRule,
75848
+ graphql29.ExecutableDefinitionsRule,
75849
+ graphql29.KnownDirectivesRule,
75850
+ graphql29.KnownArgumentNamesRule
76044
75851
  ].includes(rule)
76045
75852
  ).concat(
76046
75853
  validateLists({
@@ -76061,7 +75868,7 @@ async function typeCheck(config, docs) {
76061
75868
  validateLoadingDirective(config)
76062
75869
  );
76063
75870
  for (const { filename, document: parsed, originalString } of docs) {
76064
- for (const error of graphql30.validate(config.schema, parsed, rules(filename))) {
75871
+ for (const error of graphql29.validate(config.schema, parsed, rules(filename))) {
76065
75872
  errors.push(
76066
75873
  new HoudiniError({
76067
75874
  filepath: filename,
@@ -76090,20 +75897,20 @@ function validateRequiredDirective(config, filepath) {
76090
75897
  if (!node.directives?.some(({ name }) => name.value === config.requiredDirective))
76091
75898
  return;
76092
75899
  const parentType = parentTypeFromAncestors(config.schema, filepath, ancestors);
76093
- if (!graphql30.isObjectType(parentType)) {
75900
+ if (!graphql29.isObjectType(parentType)) {
76094
75901
  ctx.reportError(
76095
- new graphql30.GraphQLError(
75902
+ new graphql29.GraphQLError(
76096
75903
  `@${config.requiredDirective} may only be used on objects, not arguments`
76097
75904
  )
76098
75905
  );
76099
75906
  return;
76100
75907
  }
76101
75908
  const type = parentType.getFields()[node.name.value].type;
76102
- const isServerNullable = !graphql30.isNonNullType(type);
75909
+ const isServerNullable = !graphql29.isNonNullType(type);
76103
75910
  const isAlreadyClientNullable = isClientNullable(node, true);
76104
75911
  if (!isServerNullable && !isAlreadyClientNullable) {
76105
75912
  ctx.reportError(
76106
- new graphql30.GraphQLError(
75913
+ new graphql29.GraphQLError(
76107
75914
  `@${config.requiredDirective} may only be used on nullable fields`
76108
75915
  )
76109
75916
  );
@@ -76125,7 +75932,7 @@ var validateLists = ({
76125
75932
  if (!config.isListFragment(node.name.value)) {
76126
75933
  if (!fragments[node.name.value]) {
76127
75934
  ctx.reportError(
76128
- new graphql30.GraphQLError(
75935
+ new graphql29.GraphQLError(
76129
75936
  "Encountered unknown fragment: " + node.name.value
76130
75937
  )
76131
75938
  );
@@ -76135,7 +75942,7 @@ var validateLists = ({
76135
75942
  const listName = config.listNameFromFragment(node.name.value);
76136
75943
  if (!lists.includes(listName)) {
76137
75944
  ctx.reportError(
76138
- new graphql30.GraphQLError(
75945
+ new graphql29.GraphQLError(
76139
75946
  "Encountered fragment referencing unknown list: " + listName
76140
75947
  )
76141
75948
  );
@@ -76160,7 +75967,7 @@ var validateLists = ({
76160
75967
  );
76161
75968
  if (parentArg) {
76162
75969
  ctx.reportError(
76163
- new graphql30.GraphQLError(
75970
+ new graphql29.GraphQLError(
76164
75971
  `@${config.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
76165
75972
  )
76166
75973
  );
@@ -76176,7 +75983,7 @@ var validateLists = ({
76176
75983
  return;
76177
75984
  }
76178
75985
  ctx.reportError(
76179
- new graphql30.GraphQLError(
75986
+ new graphql29.GraphQLError(
76180
75987
  `For this list fragment, you need to add or @${config.listParentDirective} or @${config.listAllListsDirective} directive to specify the behavior`
76181
75988
  )
76182
75989
  );
@@ -76186,7 +75993,7 @@ var validateLists = ({
76186
75993
  const directiveName = node.name.value;
76187
75994
  if (directiveName === "connection") {
76188
75995
  ctx.reportError(
76189
- new graphql30.GraphQLError(
75996
+ new graphql29.GraphQLError(
76190
75997
  "@connection was renamed to @list. Please change your components. If you were using `cache.connection` in your components, you will need to update that to `cache.list` too."
76191
75998
  )
76192
75999
  );
@@ -76195,7 +76002,7 @@ var validateLists = ({
76195
76002
  if (!config.isInternalDirective(node.name.value)) {
76196
76003
  if (!config.schema.getDirective(directiveName)) {
76197
76004
  ctx.reportError(
76198
- new graphql30.GraphQLError(
76005
+ new graphql29.GraphQLError(
76199
76006
  "Encountered unknown directive: " + directiveName
76200
76007
  )
76201
76008
  );
@@ -76204,7 +76011,7 @@ var validateLists = ({
76204
76011
  }
76205
76012
  if (config.isListOperationDirective(directiveName) && !listTypes.includes(config.listNameFromDirective(directiveName))) {
76206
76013
  ctx.reportError(
76207
- new graphql30.GraphQLError(
76014
+ new graphql29.GraphQLError(
76208
76015
  "Encountered directive referencing unknown list: " + directiveName
76209
76016
  )
76210
76017
  );
@@ -76215,7 +76022,7 @@ var validateLists = ({
76215
76022
  };
76216
76023
  function knownArguments(config) {
76217
76024
  return function(ctx) {
76218
- const nativeValidator = graphql30.KnownArgumentNamesRule(ctx);
76025
+ const nativeValidator = graphql29.KnownArgumentNamesRule(ctx);
76219
76026
  return {
76220
76027
  ...nativeValidator,
76221
76028
  Directive(directiveNode) {
@@ -76250,7 +76057,7 @@ function validateFragmentArguments(config, filepath, fragments) {
76250
76057
  for (const arg of node.arguments || []) {
76251
76058
  if (arg.value.kind !== "ObjectValue") {
76252
76059
  ctx.reportError(
76253
- new graphql30.GraphQLError("values in @arguments must be an object")
76060
+ new graphql29.GraphQLError("values in @arguments must be an object")
76254
76061
  );
76255
76062
  return;
76256
76063
  }
@@ -76260,13 +76067,13 @@ function validateFragmentArguments(config, filepath, fragments) {
76260
76067
  );
76261
76068
  if (!typeArg) {
76262
76069
  ctx.reportError(
76263
- new graphql30.GraphQLError("missing type field for @arguments directive")
76070
+ new graphql29.GraphQLError("missing type field for @arguments directive")
76264
76071
  );
76265
76072
  return;
76266
76073
  }
76267
- if (typeArg.value.kind !== graphql30.Kind.STRING) {
76074
+ if (typeArg.value.kind !== graphql29.Kind.STRING) {
76268
76075
  ctx.reportError(
76269
- new graphql30.GraphQLError("type field to @arguments must be a string")
76076
+ new graphql29.GraphQLError("type field to @arguments must be a string")
76270
76077
  );
76271
76078
  return;
76272
76079
  }
@@ -76279,7 +76086,7 @@ function validateFragmentArguments(config, filepath, fragments) {
76279
76086
  );
76280
76087
  if (typeArg.value.value !== defaultValueType) {
76281
76088
  ctx.reportError(
76282
- new graphql30.GraphQLError(
76089
+ new graphql29.GraphQLError(
76283
76090
  `Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
76284
76091
  )
76285
76092
  );
@@ -76297,7 +76104,7 @@ function validateFragmentArguments(config, filepath, fragments) {
76297
76104
  try {
76298
76105
  args = fragmentArguments(config, filepath, fragments[fragmentName]);
76299
76106
  } catch (e3) {
76300
- ctx.reportError(new graphql30.GraphQLError(e3.message));
76107
+ ctx.reportError(new graphql29.GraphQLError(e3.message));
76301
76108
  return;
76302
76109
  }
76303
76110
  fragmentArguments2[fragmentName] = args;
@@ -76320,7 +76127,7 @@ function validateFragmentArguments(config, filepath, fragments) {
76320
76127
  );
76321
76128
  if (missing.length > 0) {
76322
76129
  ctx.reportError(
76323
- new graphql30.GraphQLError(
76130
+ new graphql29.GraphQLError(
76324
76131
  `The following arguments are missing from the "${fragmentName}" fragment: ` + JSON.stringify(missing)
76325
76132
  )
76326
76133
  );
@@ -76331,7 +76138,7 @@ function validateFragmentArguments(config, filepath, fragments) {
76331
76138
  );
76332
76139
  if (unknown.length > 0) {
76333
76140
  ctx.reportError(
76334
- new graphql30.GraphQLError(
76141
+ new graphql29.GraphQLError(
76335
76142
  "Encountered unknown arguments: " + JSON.stringify(unknown)
76336
76143
  )
76337
76144
  );
@@ -76343,7 +76150,7 @@ function validateFragmentArguments(config, filepath, fragments) {
76343
76150
  for (const [applied, target] of zipped) {
76344
76151
  if (!valueIsType(config, applied.value, target)) {
76345
76152
  ctx.reportError(
76346
- new graphql30.GraphQLError(
76153
+ new graphql29.GraphQLError(
76347
76154
  `Invalid argument type. Expected ${target}, found ${applied.value.kind}`
76348
76155
  )
76349
76156
  );
@@ -76385,7 +76192,7 @@ function valueIsType(config, value, targetType) {
76385
76192
  }
76386
76193
  if (value.kind === "EnumValue" && targetType.kind === "NamedType") {
76387
76194
  const enumType = config.schema.getType(targetType.name.value);
76388
- if (!graphql30.isEnumType(enumType)) {
76195
+ if (!graphql29.isEnumType(enumType)) {
76389
76196
  return false;
76390
76197
  }
76391
76198
  return enumType.getValues().some((enumValue) => enumValue.value === value.value);
@@ -76405,7 +76212,7 @@ function paginateArgs(config, filepath) {
76405
76212
  }
76406
76213
  if (alreadyPaginated) {
76407
76214
  ctx.reportError(
76408
- new graphql30.GraphQLError(
76215
+ new graphql29.GraphQLError(
76409
76216
  `@${config.paginateDirective} can only appear in a document once.`
76410
76217
  )
76411
76218
  );
@@ -76437,7 +76244,7 @@ function paginateArgs(config, filepath) {
76437
76244
  const backwards = appliedArgs.has("last");
76438
76245
  if (!forward && !backwards) {
76439
76246
  ctx.reportError(
76440
- new graphql30.GraphQLError(
76247
+ new graphql29.GraphQLError(
76441
76248
  "A field with cursor-based pagination must have a first or last argument"
76442
76249
  )
76443
76250
  );
@@ -76451,7 +76258,7 @@ function paginateArgs(config, filepath) {
76451
76258
  }
76452
76259
  if (forward && backwards && paginateMode === "Infinite") {
76453
76260
  ctx.reportError(
76454
- new graphql30.GraphQLError(
76261
+ new graphql29.GraphQLError(
76455
76262
  `A field with cursor pagination cannot go forwards an backwards simultaneously`
76456
76263
  )
76457
76264
  );
@@ -76465,7 +76272,7 @@ function paginateArgs(config, filepath) {
76465
76272
  );
76466
76273
  if (!appliedLimitArg) {
76467
76274
  ctx.reportError(
76468
- new graphql30.GraphQLError(
76275
+ new graphql29.GraphQLError(
76469
76276
  "A field with offset-based pagination must have a limit argument"
76470
76277
  )
76471
76278
  );
@@ -76481,20 +76288,20 @@ function noUnusedFragmentArguments(config) {
76481
76288
  const args = /* @__PURE__ */ new Set();
76482
76289
  return {
76483
76290
  enter(node) {
76484
- if (node.kind === graphql30.Kind.FRAGMENT_DEFINITION) {
76291
+ if (node.kind === graphql29.Kind.FRAGMENT_DEFINITION) {
76485
76292
  const definitionArguments = node.directives?.filter((directive) => directive.name.value === config.argumentsDirective).flatMap((directive) => directive.arguments);
76486
76293
  for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
76487
76294
  args.add(arg);
76488
76295
  }
76489
- } else if (node.kind === graphql30.Kind.VARIABLE) {
76296
+ } else if (node.kind === graphql29.Kind.VARIABLE) {
76490
76297
  args.delete(node.name.value);
76491
76298
  }
76492
76299
  },
76493
76300
  leave(node) {
76494
- if (node.kind === graphql30.Kind.FRAGMENT_DEFINITION) {
76301
+ if (node.kind === graphql29.Kind.FRAGMENT_DEFINITION) {
76495
76302
  if (args.size > 0) {
76496
76303
  ctx.reportError(
76497
- new graphql30.GraphQLError(
76304
+ new graphql29.GraphQLError(
76498
76305
  "Encountered unused fragment arguments: " + [...args].join(",")
76499
76306
  )
76500
76307
  );
@@ -76530,7 +76337,7 @@ function nodeDirectives(config, directives) {
76530
76337
  if (definition.kind === "OperationDefinition") {
76531
76338
  if (definition.operation !== "query") {
76532
76339
  ctx.reportError(
76533
- new graphql30.GraphQLError(
76340
+ new graphql29.GraphQLError(
76534
76341
  `@${node.name.value} must fall on a fragment or query document`
76535
76342
  )
76536
76343
  );
@@ -76542,7 +76349,7 @@ function nodeDirectives(config, directives) {
76542
76349
  }
76543
76350
  if (!possibleNodes.includes(definitionType)) {
76544
76351
  ctx.reportError(
76545
- new graphql30.GraphQLError(paginateOnNonNodeMessage(node.name.value))
76352
+ new graphql29.GraphQLError(paginateOnNonNodeMessage(node.name.value))
76546
76353
  );
76547
76354
  }
76548
76355
  }
@@ -76561,7 +76368,7 @@ function checkMutationOperation(config) {
76561
76368
  );
76562
76369
  if (append && prepend) {
76563
76370
  ctx.reportError(
76564
- new graphql30.GraphQLError(
76371
+ new graphql29.GraphQLError(
76565
76372
  `You can't apply both @${config.listPrependDirective} and @${config.listAppendDirective} at the same time`
76566
76373
  )
76567
76374
  );
@@ -76575,7 +76382,7 @@ function checkMutationOperation(config) {
76575
76382
  );
76576
76383
  if (parentId && allLists) {
76577
76384
  ctx.reportError(
76578
- new graphql30.GraphQLError(
76385
+ new graphql29.GraphQLError(
76579
76386
  `You can't apply both @${config.listParentDirective} and @${config.listAllListsDirective} at the same time`
76580
76387
  )
76581
76388
  );
@@ -76597,7 +76404,7 @@ function checkMaskDirectives(config) {
76597
76404
  );
76598
76405
  if (maskEnableDirective && maskDisableDirective) {
76599
76406
  ctx.reportError(
76600
- new graphql30.GraphQLError(
76407
+ new graphql29.GraphQLError(
76601
76408
  `You can't apply both @${config.maskEnableDirective} and @${config.maskDisableDirective} at the same time`
76602
76409
  )
76603
76410
  );
@@ -76639,7 +76446,7 @@ function validateLoadingDirective(config) {
76639
76446
  );
76640
76447
  if (!parentLoading && !global2) {
76641
76448
  ctx.reportError(
76642
- new graphql30.GraphQLError(
76449
+ new graphql29.GraphQLError(
76643
76450
  `@${config.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config.loadingDirective}`
76644
76451
  )
76645
76452
  );
@@ -76661,7 +76468,7 @@ function validateLoadingDirective(config) {
76661
76468
  );
76662
76469
  if (!parentLoading && !global2) {
76663
76470
  ctx.reportError(
76664
- new graphql30.GraphQLError(
76471
+ new graphql29.GraphQLError(
76665
76472
  `@${config.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config.loadingDirective}`
76666
76473
  )
76667
76474
  );
@@ -76676,7 +76483,7 @@ function getAndVerifyNodeInterface(config) {
76676
76483
  if (!nodeInterface) {
76677
76484
  return null;
76678
76485
  }
76679
- if (!graphql30.isInterfaceType(nodeInterface)) {
76486
+ if (!graphql29.isInterfaceType(nodeInterface)) {
76680
76487
  displayInvalidNodeFieldMessage(config);
76681
76488
  return null;
76682
76489
  }
@@ -76771,11 +76578,11 @@ async function uniqueDocumentNames(config, docs) {
76771
76578
  }
76772
76579
 
76773
76580
  // src/codegen/validators/noIDAlias.ts
76774
- import * as graphql31 from "graphql";
76581
+ import * as graphql30 from "graphql";
76775
76582
  async function noIDAlias(config, docs) {
76776
76583
  const errors = [];
76777
76584
  for (const { filename, document } of docs) {
76778
- graphql31.visit(document, {
76585
+ graphql30.visit(document, {
76779
76586
  Field(node, _3, __, ___, ancestors) {
76780
76587
  const fieldType = parentTypeFromAncestors(config.schema, filename, ancestors).name;
76781
76588
  if (config.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
@@ -76814,11 +76621,11 @@ async function validatePlugins(config, documents) {
76814
76621
  }
76815
76622
 
76816
76623
  // src/codegen/validators/componentFields.ts
76817
- import * as graphql32 from "graphql";
76624
+ import * as graphql31 from "graphql";
76818
76625
  async function componentFields2(config, docs) {
76819
76626
  const errors = [];
76820
76627
  for (const { filename: filepath, document } of docs) {
76821
- graphql32.visit(document, {
76628
+ graphql31.visit(document, {
76822
76629
  FragmentDefinition(node, _3, __, ___, ancestors) {
76823
76630
  const componentFieldDirective = node.directives?.find(
76824
76631
  (dir) => dir.name.value === config.componentFieldDirective
@@ -76866,7 +76673,7 @@ async function componentFields2(config, docs) {
76866
76673
  if (existingField && existingField.filepath !== filepath) {
76867
76674
  conflict = true;
76868
76675
  } else if (parentType && fieldValue) {
76869
- const fieldDef = graphql32.isObjectType(parentType) && parentType.getFields()[fieldValue];
76676
+ const fieldDef = graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue];
76870
76677
  if (fieldDef && !fieldDef.astNode?.directives?.find(
76871
76678
  (dir) => dir.name.value === config.componentFieldDirective
76872
76679
  )) {
@@ -76879,7 +76686,7 @@ async function componentFields2(config, docs) {
76879
76686
  filepath
76880
76687
  });
76881
76688
  }
76882
- if (parentType && graphql32.isAbstractType(parentType)) {
76689
+ if (parentType && graphql31.isAbstractType(parentType)) {
76883
76690
  errors.push({
76884
76691
  message: `Cannot add component field ${parent2}.${fieldValue} because ${parent2} is an abstract type`,
76885
76692
  filepath
@@ -77100,12 +76907,12 @@ async function processJSFile(config, contents) {
77100
76907
  return documents;
77101
76908
  }
77102
76909
  async function processGraphQLDocument(config, filepath, document) {
77103
- const parsedDoc = graphql33.parse(document);
76910
+ const parsedDoc = graphql32.parse(document);
77104
76911
  const operations = parsedDoc.definitions.filter(
77105
- ({ kind: kind2 }) => kind2 === graphql33.Kind.OPERATION_DEFINITION
76912
+ ({ kind: kind2 }) => kind2 === graphql32.Kind.OPERATION_DEFINITION
77106
76913
  );
77107
76914
  const fragments = parsedDoc.definitions.filter(
77108
- ({ kind: kind2 }) => kind2 === graphql33.Kind.FRAGMENT_DEFINITION
76915
+ ({ kind: kind2 }) => kind2 === graphql32.Kind.FRAGMENT_DEFINITION
77109
76916
  );
77110
76917
  if (operations.length > 1) {
77111
76918
  throw new HoudiniError({
@@ -78221,12 +78028,12 @@ async function packageJSON(targetPath, frameworkInfo) {
78221
78028
  }
78222
78029
  packageJSON2.devDependencies = {
78223
78030
  ...packageJSON2.devDependencies,
78224
- houdini: "^1.2.44"
78031
+ houdini: "^1.2.45"
78225
78032
  };
78226
78033
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
78227
78034
  packageJSON2.devDependencies = {
78228
78035
  ...packageJSON2.devDependencies,
78229
- "houdini-svelte": "^1.2.44"
78036
+ "houdini-svelte": "^1.2.45"
78230
78037
  };
78231
78038
  } else {
78232
78039
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);