houdini 1.2.43 → 1.2.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/build/cmd-cjs/index.js +684 -786
  2. package/build/cmd-esm/index.js +534 -636
  3. package/build/codegen/generators/artifacts/inputs.d.ts +1 -1
  4. package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
  5. package/build/codegen/transforms/index.d.ts +1 -0
  6. package/build/codegen/transforms/runtimeScalars.d.ts +2 -0
  7. package/build/codegen-cjs/index.js +677 -782
  8. package/build/codegen-esm/index.js +527 -632
  9. package/build/lib/config.d.ts +1 -0
  10. package/build/lib/graphql.d.ts +1 -1
  11. package/build/lib/index.d.ts +1 -0
  12. package/build/lib/typescript.d.ts +19 -0
  13. package/build/lib-cjs/index.js +711 -477
  14. package/build/lib-esm/index.js +705 -477
  15. package/build/runtime/client/index.d.ts +7 -1
  16. package/build/runtime/client/plugins/fragment.d.ts +2 -2
  17. package/build/runtime/client/plugins/mutation.d.ts +2 -1
  18. package/build/runtime/client/plugins/query.d.ts +2 -2
  19. package/build/runtime/lib/config.d.ts +12 -2
  20. package/build/runtime/lib/scalars.d.ts +1 -1
  21. package/build/runtime/lib/types.d.ts +17 -2
  22. package/build/runtime/router/session.d.ts +1 -2
  23. package/build/runtime/router/types.d.ts +3 -1
  24. package/build/runtime-cjs/client/index.d.ts +7 -1
  25. package/build/runtime-cjs/client/index.js +26 -11
  26. package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
  27. package/build/runtime-cjs/client/plugins/fragment.js +4 -11
  28. package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
  29. package/build/runtime-cjs/client/plugins/mutation.js +8 -15
  30. package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
  31. package/build/runtime-cjs/client/plugins/query.js +18 -11
  32. package/build/runtime-cjs/lib/config.d.ts +12 -2
  33. package/build/runtime-cjs/lib/scalars.d.ts +1 -1
  34. package/build/runtime-cjs/lib/scalars.js +4 -0
  35. package/build/runtime-cjs/lib/types.d.ts +17 -2
  36. package/build/runtime-cjs/router/server.js +2 -3
  37. package/build/runtime-cjs/router/session.d.ts +1 -2
  38. package/build/runtime-cjs/router/session.js +25 -11
  39. package/build/runtime-cjs/router/types.d.ts +3 -1
  40. package/build/runtime-esm/client/index.d.ts +7 -1
  41. package/build/runtime-esm/client/index.js +26 -11
  42. package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
  43. package/build/runtime-esm/client/plugins/fragment.js +1 -2
  44. package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
  45. package/build/runtime-esm/client/plugins/mutation.js +1 -2
  46. package/build/runtime-esm/client/plugins/query.d.ts +2 -2
  47. package/build/runtime-esm/client/plugins/query.js +15 -2
  48. package/build/runtime-esm/lib/config.d.ts +12 -2
  49. package/build/runtime-esm/lib/scalars.d.ts +1 -1
  50. package/build/runtime-esm/lib/scalars.js +6 -0
  51. package/build/runtime-esm/lib/types.d.ts +17 -2
  52. package/build/runtime-esm/router/server.js +2 -3
  53. package/build/runtime-esm/router/session.d.ts +1 -2
  54. package/build/runtime-esm/router/session.js +25 -11
  55. package/build/runtime-esm/router/types.d.ts +3 -1
  56. package/build/test-cjs/index.js +706 -785
  57. package/build/test-esm/index.js +556 -635
  58. package/build/vite-cjs/index.js +793 -793
  59. package/build/vite-esm/index.js +643 -643
  60. package/package.json +1 -1
  61. package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
  62. package/build/codegen/generators/typescript/types.d.ts +0 -10
@@ -24845,7 +24845,7 @@ var require_path_visitor = __commonJS({
24845
24845
  }
24846
24846
  return target;
24847
24847
  }
24848
- PathVisitor.visit = function visit18(node, methods) {
24848
+ PathVisitor.visit = function visit19(node, methods) {
24849
24849
  return PathVisitor.fromMethodsObject(methods).visit(node);
24850
24850
  };
24851
24851
  var PVp = PathVisitor.prototype;
@@ -25036,7 +25036,7 @@ var require_path_visitor = __commonJS({
25036
25036
  this.needToCallTraverse = false;
25037
25037
  return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
25038
25038
  };
25039
- sharedContextProtoMethods.visit = function visit18(path2, newVisitor) {
25039
+ sharedContextProtoMethods.visit = function visit19(path2, newVisitor) {
25040
25040
  if (!(this instanceof this.Context)) {
25041
25041
  throw new Error("");
25042
25042
  }
@@ -26429,7 +26429,7 @@ var require_main = __commonJS({
26429
26429
  var someField = _a.someField;
26430
26430
  var Type = _a.Type;
26431
26431
  var use = _a.use;
26432
- var visit18 = _a.visit;
26432
+ var visit19 = _a.visit;
26433
26433
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
26434
26434
  exports.builders = builders;
26435
26435
  exports.builtInTypes = builtInTypes;
@@ -26446,7 +26446,7 @@ var require_main = __commonJS({
26446
26446
  exports.someField = someField;
26447
26447
  exports.Type = Type;
26448
26448
  exports.use = use;
26449
- exports.visit = visit18;
26449
+ exports.visit = visit19;
26450
26450
  Object.assign(namedTypes_1.namedTypes, n);
26451
26451
  }
26452
26452
  });
@@ -53965,47 +53965,6 @@ function deepMerge(...objects) {
53965
53965
  return mergedObj;
53966
53966
  }
53967
53967
 
53968
- // src/runtime/lib/scalars.ts
53969
- async function marshalSelection({
53970
- selection,
53971
- data
53972
- }) {
53973
- const config = getCurrentConfig();
53974
- if (data === null || typeof data === "undefined") {
53975
- return data;
53976
- }
53977
- if (Array.isArray(data)) {
53978
- return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
53979
- }
53980
- const targetSelection = getFieldsForType(selection, data["__typename"], false);
53981
- return Object.fromEntries(
53982
- await Promise.all(
53983
- Object.entries(data).map(async ([fieldName, value]) => {
53984
- const { type, selection: selection2 } = targetSelection[fieldName];
53985
- if (!type) {
53986
- return [fieldName, value];
53987
- }
53988
- if (selection2) {
53989
- return [fieldName, await marshalSelection({ selection: selection2, data: value })];
53990
- }
53991
- if (config.scalars?.[type]) {
53992
- const marshalFn = config.scalars[type].marshal;
53993
- if (!marshalFn) {
53994
- throw new Error(
53995
- `scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
53996
- );
53997
- }
53998
- if (Array.isArray(value)) {
53999
- return [fieldName, value.map(marshalFn)];
54000
- }
54001
- return [fieldName, marshalFn(value)];
54002
- }
54003
- return [fieldName, value];
54004
- })
54005
- )
54006
- );
54007
- }
54008
-
54009
53968
  // src/runtime/lib/types.ts
54010
53969
  var CachePolicy = {
54011
53970
  CacheOrNetwork: "CacheOrNetwork",
@@ -54033,11 +53992,6 @@ var RefetchUpdateMode = {
54033
53992
  prepend: "prepend",
54034
53993
  replace: "replace"
54035
53994
  };
54036
- var DataSource = {
54037
- Cache: "cache",
54038
- Network: "network",
54039
- Ssr: "ssr"
54040
- };
54041
53995
  var fragmentKey = " $fragments";
54042
53996
  var PendingValue = Symbol("houdini_loading");
54043
53997
 
@@ -56659,188 +56613,6 @@ var cache_default = new Cache();
56659
56613
  // src/runtime/client/plugins/cache.ts
56660
56614
  var serverSide = typeof globalThis.window === "undefined";
56661
56615
 
56662
- // src/runtime/client/utils/documentPlugins.ts
56663
- var documentPlugin = (kind, source) => {
56664
- return () => {
56665
- const sourceHandlers = source();
56666
- const enterWrapper = (handler) => {
56667
- return !handler ? void 0 : (ctx, handlers) => {
56668
- if (ctx.artifact.kind !== kind) {
56669
- return handlers.next(ctx);
56670
- }
56671
- return handler(ctx, handlers);
56672
- };
56673
- };
56674
- const exitWrapper = (handler) => {
56675
- return !handler ? void 0 : (ctx, handlers) => {
56676
- if (ctx.artifact.kind !== kind) {
56677
- return handlers.resolve(ctx);
56678
- }
56679
- return handler(ctx, handlers);
56680
- };
56681
- };
56682
- return {
56683
- start: enterWrapper(sourceHandlers.start),
56684
- network: enterWrapper(sourceHandlers.network),
56685
- afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
56686
- end: exitWrapper(sourceHandlers.end),
56687
- catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
56688
- cleanup: (...args) => sourceHandlers.cleanup?.(...args)
56689
- };
56690
- };
56691
- };
56692
-
56693
- // src/runtime/client/plugins/query.ts
56694
- var query = documentPlugin(ArtifactKind.Query, function() {
56695
- let subscriptionSpec = null;
56696
- let lastVariables = null;
56697
- return {
56698
- start(ctx, { next }) {
56699
- ctx.variables = {
56700
- ...lastVariables,
56701
- ...ctx.variables
56702
- };
56703
- next(ctx);
56704
- },
56705
- end(ctx, { resolve: resolve2, marshalVariables, variablesChanged }) {
56706
- if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
56707
- if (subscriptionSpec) {
56708
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
56709
- }
56710
- lastVariables = { ...marshalVariables(ctx) };
56711
- const variables = lastVariables;
56712
- subscriptionSpec = {
56713
- rootType: ctx.artifact.rootType,
56714
- selection: ctx.artifact.selection,
56715
- variables: () => variables,
56716
- set: (newValue) => {
56717
- resolve2(ctx, {
56718
- data: newValue,
56719
- errors: null,
56720
- fetching: false,
56721
- partial: false,
56722
- stale: false,
56723
- source: DataSource.Cache,
56724
- variables: ctx.variables ?? {}
56725
- });
56726
- }
56727
- };
56728
- cache_default.subscribe(subscriptionSpec, lastVariables);
56729
- }
56730
- resolve2(ctx);
56731
- },
56732
- cleanup() {
56733
- if (subscriptionSpec) {
56734
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
56735
- lastVariables = null;
56736
- }
56737
- }
56738
- };
56739
- });
56740
-
56741
- // src/runtime/client/plugins/fragment.ts
56742
- var fragment = documentPlugin(ArtifactKind.Fragment, function() {
56743
- let subscriptionSpec = null;
56744
- let lastReference = null;
56745
- return {
56746
- start(ctx, { next, resolve: resolve2, variablesChanged, marshalVariables }) {
56747
- if (!ctx.stuff.parentID) {
56748
- return next(ctx);
56749
- }
56750
- const currentReference = {
56751
- parent: ctx.stuff.parentID,
56752
- variables: marshalVariables(ctx)
56753
- };
56754
- if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged(ctx))) {
56755
- if (subscriptionSpec) {
56756
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
56757
- }
56758
- const variables = marshalVariables(ctx);
56759
- subscriptionSpec = {
56760
- rootType: ctx.artifact.rootType,
56761
- selection: ctx.artifact.selection,
56762
- variables: () => variables,
56763
- parentID: ctx.stuff.parentID,
56764
- set: (newValue) => {
56765
- resolve2(ctx, {
56766
- data: newValue,
56767
- errors: null,
56768
- fetching: false,
56769
- partial: false,
56770
- stale: false,
56771
- source: DataSource.Cache,
56772
- variables
56773
- });
56774
- }
56775
- };
56776
- cache_default.subscribe(subscriptionSpec, variables);
56777
- lastReference = currentReference;
56778
- }
56779
- next(ctx);
56780
- },
56781
- cleanup() {
56782
- if (subscriptionSpec) {
56783
- cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
56784
- }
56785
- }
56786
- };
56787
- });
56788
-
56789
- // src/runtime/client/plugins/mutation.ts
56790
- var mutation = documentPlugin(ArtifactKind.Mutation, () => {
56791
- return {
56792
- async start(ctx, { next, marshalVariables }) {
56793
- const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
56794
- const optimisticResponse = ctx.stuff.optimisticResponse;
56795
- let toNotify = [];
56796
- if (optimisticResponse) {
56797
- toNotify = cache_default.write({
56798
- selection: ctx.artifact.selection,
56799
- data: await marshalSelection({
56800
- selection: ctx.artifact.selection,
56801
- data: optimisticResponse
56802
- }),
56803
- variables: marshalVariables(ctx),
56804
- layer: layerOptimistic.id
56805
- });
56806
- }
56807
- ctx.cacheParams = {
56808
- ...ctx.cacheParams,
56809
- layer: layerOptimistic,
56810
- notifySubscribers: toNotify,
56811
- forceNotify: true
56812
- };
56813
- next(ctx);
56814
- },
56815
- afterNetwork(ctx, { resolve: resolve2 }) {
56816
- if (ctx.cacheParams?.layer) {
56817
- cache_default.clearLayer(ctx.cacheParams.layer.id);
56818
- }
56819
- resolve2(ctx);
56820
- },
56821
- end(ctx, { resolve: resolve2, value }) {
56822
- const hasErrors = value.errors && value.errors.length > 0;
56823
- if (hasErrors) {
56824
- if (ctx.cacheParams?.layer) {
56825
- cache_default.clearLayer(ctx.cacheParams.layer.id);
56826
- }
56827
- }
56828
- if (ctx.cacheParams?.layer) {
56829
- cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
56830
- }
56831
- resolve2(ctx);
56832
- },
56833
- catch(ctx, { error }) {
56834
- if (ctx.cacheParams?.layer) {
56835
- const { layer } = ctx.cacheParams;
56836
- cache_default.clearLayer(layer.id);
56837
- cache_default._internal_unstable.storage.resolveLayer(layer.id);
56838
- }
56839
- throw error;
56840
- }
56841
- };
56842
- });
56843
-
56844
56616
  // src/lib/types.ts
56845
56617
  var LogLevel = {
56846
56618
  Full: "full",
@@ -56959,7 +56731,7 @@ function definitionFromAncestors(ancestors) {
56959
56731
  }
56960
56732
  return { parents, definition };
56961
56733
  }
56962
- function unwrapType(config, type, wrappers = []) {
56734
+ function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
56963
56735
  if (type.kind === "NonNullType") {
56964
56736
  return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
56965
56737
  }
@@ -56975,9 +56747,14 @@ function unwrapType(config, type, wrappers = []) {
56975
56747
  if (type instanceof graphql3.GraphQLList) {
56976
56748
  return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
56977
56749
  }
56750
+ if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
56751
+ type = config.schema.getType(
56752
+ config.configFile.features?.runtimeScalars?.[type.name.value].type
56753
+ );
56754
+ }
56978
56755
  const namedType = config.schema.getType(type.name.value || type.name);
56979
56756
  if (!namedType) {
56980
- throw new Error("Could not unwrap type: " + JSON.stringify(type));
56757
+ throw new Error("Unknown type: " + type.name.value || type.name);
56981
56758
  }
56982
56759
  return { type: namedType, wrappers };
56983
56760
  }
@@ -57114,6 +56891,152 @@ async function cleanupFiles(pathFolder, listOfObj) {
57114
56891
  return allFilesNotInList;
57115
56892
  }
57116
56893
 
56894
+ // src/lib/typescript.ts
56895
+ var graphql4 = __toESM(require("graphql"), 1);
56896
+ var recast2 = __toESM(require_main2(), 1);
56897
+ var AST2 = recast2.types.builders;
56898
+ function unwrappedTsTypeReference(config, filepath, missingScalars, {
56899
+ type,
56900
+ wrappers
56901
+ }, body) {
56902
+ let result;
56903
+ if (graphql4.isScalarType(type)) {
56904
+ result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
56905
+ } else if (graphql4.isEnumType(type)) {
56906
+ result = enumReference(config, body, type.name);
56907
+ } else {
56908
+ result = AST2.tsTypeReference(AST2.identifier(type.name));
56909
+ }
56910
+ for (const toWrap of wrappers) {
56911
+ if (toWrap === "NonNull" /* NonNull */) {
56912
+ continue;
56913
+ } else if (toWrap === "Nullable" /* Nullable */) {
56914
+ result = nullableField(result, true);
56915
+ } else if (toWrap === "List" /* List */) {
56916
+ result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
56917
+ }
56918
+ }
56919
+ return result;
56920
+ }
56921
+ function tsTypeReference(config, filepath, missingScalars, definition, body) {
56922
+ const { type, wrappers } = unwrapType(config, definition.type);
56923
+ return unwrappedTsTypeReference(
56924
+ config,
56925
+ filepath,
56926
+ missingScalars,
56927
+ { type, wrappers },
56928
+ body
56929
+ );
56930
+ }
56931
+ function enumReference(config, body, name) {
56932
+ ensureImports({
56933
+ config,
56934
+ body,
56935
+ import: ["ValueOf"],
56936
+ importKind: "type",
56937
+ sourceModule: "$houdini/runtime/lib/types"
56938
+ });
56939
+ return AST2.tsTypeReference(
56940
+ AST2.identifier("ValueOf"),
56941
+ AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
56942
+ );
56943
+ }
56944
+ function readonlyProperty(prop, enable = true) {
56945
+ if (enable) {
56946
+ prop.readonly = true;
56947
+ }
56948
+ return prop;
56949
+ }
56950
+ function nullableField(inner, input = false) {
56951
+ const members = [inner, AST2.tsNullKeyword()];
56952
+ if (input) {
56953
+ members.push(AST2.tsUndefinedKeyword());
56954
+ }
56955
+ return AST2.tsUnionType(members);
56956
+ }
56957
+ function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
56958
+ if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
56959
+ if (!field) {
56960
+ return AST2.tsNeverKeyword();
56961
+ }
56962
+ const component = config.componentFields[field.parent][field.field];
56963
+ const sourcePathRelative = path_exports.relative(
56964
+ path_exports.join(config.projectRoot, "src"),
56965
+ component.filepath
56966
+ );
56967
+ let sourcePathParsed = path_exports.parse(sourcePathRelative);
56968
+ let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
56969
+ const localImport = ensureImports({
56970
+ config,
56971
+ body,
56972
+ import: "__component__" + component.fragment,
56973
+ sourceModule: path_exports.join(
56974
+ path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
56975
+ "src",
56976
+ sourcePath
56977
+ )
56978
+ }) ?? "__component__" + component.fragment;
56979
+ const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
56980
+ parameters.typeParameters = AST2.tsTypeParameterInstantiation([
56981
+ AST2.tsTypeQuery(AST2.identifier(localImport))
56982
+ ]);
56983
+ const indexed = AST2.tsIndexedAccessType(
56984
+ parameters,
56985
+ AST2.tsLiteralType(AST2.numericLiteral(0))
56986
+ );
56987
+ const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
56988
+ omit.typeParameters = AST2.tsTypeParameterInstantiation([
56989
+ indexed,
56990
+ AST2.tsLiteralType(AST2.stringLiteral(component.prop))
56991
+ ]);
56992
+ const arg = AST2.identifier("props");
56993
+ arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
56994
+ const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
56995
+ returnType.typeParameters = AST2.tsTypeParameterInstantiation([
56996
+ AST2.tsTypeQuery(AST2.identifier(localImport))
56997
+ ]);
56998
+ const fnType = AST2.tsFunctionType([arg]);
56999
+ fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
57000
+ return fnType;
57001
+ }
57002
+ switch (target.name) {
57003
+ case "String": {
57004
+ return AST2.tsStringKeyword();
57005
+ }
57006
+ case "Int": {
57007
+ return AST2.tsNumberKeyword();
57008
+ }
57009
+ case "Float": {
57010
+ return AST2.tsNumberKeyword();
57011
+ }
57012
+ case "Boolean": {
57013
+ return AST2.tsBooleanKeyword();
57014
+ }
57015
+ case "ID": {
57016
+ return AST2.tsStringKeyword();
57017
+ }
57018
+ default: {
57019
+ if (graphql4.isNonNullType(target) && "ofType" in target) {
57020
+ return scalarPropertyValue(
57021
+ config,
57022
+ filepath,
57023
+ missingScalars,
57024
+ target.ofType,
57025
+ body,
57026
+ field
57027
+ );
57028
+ }
57029
+ if (config.scalars?.[target.name]) {
57030
+ return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
57031
+ }
57032
+ if (target.name !== config.componentScalar) {
57033
+ missingScalars.add(target.name);
57034
+ }
57035
+ return AST2.tsAnyKeyword();
57036
+ }
57037
+ }
57038
+ }
57039
+
57117
57040
  // ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
57118
57041
  var WalkerBase = class {
57119
57042
  constructor() {
@@ -57227,7 +57150,7 @@ async function asyncWalk(ast, { enter, leave }) {
57227
57150
  }
57228
57151
 
57229
57152
  // src/lib/walk.ts
57230
- var graphql4 = __toESM(require("graphql"), 1);
57153
+ var graphql5 = __toESM(require("graphql"), 1);
57231
57154
  async function find_graphql(config, parsedScript, walker) {
57232
57155
  await asyncWalk(parsedScript, {
57233
57156
  async enter(node, parent2) {
@@ -57282,7 +57205,7 @@ async function find_graphql(config, parsedScript, walker) {
57282
57205
  } else if (!documentString) {
57283
57206
  return;
57284
57207
  }
57285
- const parsedTag = graphql4.parse(documentString);
57208
+ const parsedTag = graphql5.parse(documentString);
57286
57209
  if (walker.where && !walker.where(parsedTag, { node, parent: parent2 })) {
57287
57210
  return;
57288
57211
  }
@@ -57414,7 +57337,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
57414
57337
  };
57415
57338
  return defs.concat([
57416
57339
  {
57417
- raw: graphql4.print(parsed),
57340
+ raw: graphql5.print(parsed),
57418
57341
  parsed
57419
57342
  }
57420
57343
  ]);
@@ -57429,11 +57352,11 @@ function extractAnonymousQuery(config, raw, expr, propName) {
57429
57352
 
57430
57353
  // src/lib/router/manifest.ts
57431
57354
  var t = __toESM(require_lib6(), 1);
57432
- var graphql5 = __toESM(require("graphql"), 1);
57355
+ var graphql6 = __toESM(require("graphql"), 1);
57433
57356
 
57434
57357
  // src/codegen/generators/artifacts/index.ts
57435
- var graphql16 = __toESM(require("graphql"), 1);
57436
- var recast4 = __toESM(require_main2(), 1);
57358
+ var graphql17 = __toESM(require("graphql"), 1);
57359
+ var recast5 = __toESM(require_main2(), 1);
57437
57360
 
57438
57361
  // src/codegen/utils/commonjs.ts
57439
57362
  var cjsIndexFilePreamble = `"use strict";
@@ -57675,19 +57598,19 @@ var FieldCollection = class {
57675
57598
  };
57676
57599
 
57677
57600
  // src/codegen/utils/moduleExport.ts
57678
- var recast2 = __toESM(require_main2(), 1);
57679
- var AST2 = recast2.types.builders;
57601
+ var recast3 = __toESM(require_main2(), 1);
57602
+ var AST3 = recast3.types.builders;
57680
57603
  function moduleExport(config, key, value) {
57681
57604
  if (config.module === "commonjs") {
57682
- let target = AST2.memberExpression(AST2.identifier("module"), AST2.identifier("exports"));
57605
+ let target = AST3.memberExpression(AST3.identifier("module"), AST3.identifier("exports"));
57683
57606
  if (key !== "default") {
57684
- target = AST2.memberExpression(target, AST2.identifier(key));
57607
+ target = AST3.memberExpression(target, AST3.identifier(key));
57685
57608
  }
57686
- return AST2.expressionStatement(AST2.assignmentExpression("=", target, value));
57609
+ return AST3.expressionStatement(AST3.assignmentExpression("=", target, value));
57687
57610
  }
57688
- return key === "default" ? AST2.exportDefaultDeclaration(value) : AST2.exportNamedDeclaration(
57689
- AST2.variableDeclaration("const", [
57690
- AST2.variableDeclarator(AST2.identifier(key), value)
57611
+ return key === "default" ? AST3.exportDefaultDeclaration(value) : AST3.exportNamedDeclaration(
57612
+ AST3.variableDeclaration("const", [
57613
+ AST3.variableDeclarator(AST3.identifier(key), value)
57691
57614
  ])
57692
57615
  );
57693
57616
  }
@@ -57944,7 +57867,7 @@ var serialize = (value, { json, lossy } = {}) => {
57944
57867
  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));
57945
57868
 
57946
57869
  // src/codegen/transforms/fragmentVariables.ts
57947
- var graphql7 = __toESM(require("graphql"), 1);
57870
+ var graphql8 = __toESM(require("graphql"), 1);
57948
57871
 
57949
57872
  // src/codegen/utils/stripLoc.ts
57950
57873
  function stripLoc(value) {
@@ -57965,13 +57888,13 @@ function stripLoc(value) {
57965
57888
  }
57966
57889
 
57967
57890
  // src/codegen/transforms/collectDefinitions.ts
57968
- var graphql6 = __toESM(require("graphql"), 1);
57969
- var import_graphql = require("graphql");
57891
+ var graphql7 = __toESM(require("graphql"), 1);
57892
+ var import_graphql2 = require("graphql");
57970
57893
  async function includeFragmentDefinitions(config, documents) {
57971
57894
  const fragments = collectDefinitions(config, documents);
57972
57895
  for (const [index, { name, document, filename }] of documents.entries()) {
57973
57896
  const operation = document.definitions.find(
57974
- (def) => def.kind === import_graphql.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
57897
+ (def) => def.kind === import_graphql2.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
57975
57898
  );
57976
57899
  if (!operation) {
57977
57900
  continue;
@@ -58015,10 +57938,10 @@ function collectDefinitions(config, docs) {
58015
57938
  }
58016
57939
  function findRequiredFragments(config, definition) {
58017
57940
  const referencedFragments = [];
58018
- const typeInfo = new graphql6.TypeInfo(config.schema);
58019
- definition.selectionSet = graphql6.visit(
57941
+ const typeInfo = new graphql7.TypeInfo(config.schema);
57942
+ definition.selectionSet = graphql7.visit(
58020
57943
  definition,
58021
- graphql6.visitWithTypeInfo(typeInfo, {
57944
+ graphql7.visitWithTypeInfo(typeInfo, {
58022
57945
  FragmentSpread(node) {
58023
57946
  referencedFragments.push(node.name.value);
58024
57947
  }
@@ -58052,7 +57975,7 @@ function flattenFragments(filepath, operation, fragments) {
58052
57975
  }
58053
57976
 
58054
57977
  // src/codegen/transforms/fragmentVariables.ts
58055
- var GraphqlKinds2 = graphql7.Kind;
57978
+ var GraphqlKinds2 = graphql8.Kind;
58056
57979
  async function fragmentVariables(config, documents) {
58057
57980
  const fragments = collectDefinitions(config, documents);
58058
57981
  const generatedFragments = {};
@@ -58075,7 +57998,7 @@ async function fragmentVariables(config, documents) {
58075
57998
  });
58076
57999
  }
58077
58000
  const doc = {
58078
- kind: graphql7.Kind.DOCUMENT,
58001
+ kind: graphql8.Kind.DOCUMENT,
58079
58002
  definitions: Object.values(generatedFragments)
58080
58003
  };
58081
58004
  documents.push({
@@ -58146,7 +58069,7 @@ function inlineFragmentArgs({
58146
58069
  return null;
58147
58070
  };
58148
58071
  const result = esm_default(
58149
- graphql7.visit(document, {
58072
+ graphql8.visit(document, {
58150
58073
  FragmentSpread(node) {
58151
58074
  if (!fragmentDefinitions[node.name.value]) {
58152
58075
  throw new Error("Could not find definition for fragment" + node.name.value);
@@ -58232,7 +58155,7 @@ function inlineFragmentArgs({
58232
58155
  );
58233
58156
  if (newName) {
58234
58157
  result.name = {
58235
- kind: graphql7.Kind.NAME,
58158
+ kind: graphql8.Kind.NAME,
58236
58159
  value: newName
58237
58160
  };
58238
58161
  }
@@ -58399,8 +58322,8 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
58399
58322
  }
58400
58323
 
58401
58324
  // src/codegen/generators/artifacts/inputs.ts
58402
- var graphql8 = __toESM(require("graphql"), 1);
58403
- function inputObject(config, inputs) {
58325
+ var graphql9 = __toESM(require("graphql"), 1);
58326
+ function inputObject(config, inputs, runtimeScalars) {
58404
58327
  const visitedTypes = /* @__PURE__ */ new Set();
58405
58328
  const inputObj = {
58406
58329
  fields: inputs.reduce((fields, input) => {
@@ -58416,7 +58339,8 @@ function inputObject(config, inputs) {
58416
58339
  ...fields,
58417
58340
  [input.variable.name.value]: input.defaultValue ? variableValue(input.defaultValue, {}) : void 0
58418
58341
  };
58419
- }, {})
58342
+ }, {}),
58343
+ runtimeScalars
58420
58344
  };
58421
58345
  for (const input of inputs) {
58422
58346
  walkInputs(config, visitedTypes, inputObj, input.type);
@@ -58428,10 +58352,10 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
58428
58352
  if (visitedTypes.has(type.name)) {
58429
58353
  return;
58430
58354
  }
58431
- if (graphql8.isEnumType(type) || graphql8.isScalarType(type)) {
58355
+ if (graphql9.isEnumType(type) || graphql9.isScalarType(type)) {
58432
58356
  return;
58433
58357
  }
58434
- if (graphql8.isUnionType(type)) {
58358
+ if (graphql9.isUnionType(type)) {
58435
58359
  return;
58436
58360
  }
58437
58361
  visitedTypes.add(type.name);
@@ -58449,50 +58373,50 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
58449
58373
  }
58450
58374
 
58451
58375
  // src/codegen/generators/artifacts/operations.ts
58452
- var graphql10 = __toESM(require("graphql"), 1);
58376
+ var graphql11 = __toESM(require("graphql"), 1);
58453
58377
 
58454
58378
  // src/codegen/generators/artifacts/utils.ts
58455
- var graphql9 = __toESM(require("graphql"), 1);
58456
- var recast3 = __toESM(require_main2(), 1);
58457
- var AST3 = recast3.types.builders;
58379
+ var graphql10 = __toESM(require("graphql"), 1);
58380
+ var recast4 = __toESM(require_main2(), 1);
58381
+ var AST4 = recast4.types.builders;
58458
58382
  function serializeValue(value) {
58459
58383
  if (Array.isArray(value)) {
58460
- return AST3.arrayExpression(value.map(serializeValue));
58384
+ return AST4.arrayExpression(value.map(serializeValue));
58461
58385
  }
58462
58386
  if (typeof value === "object" && value !== null) {
58463
- return AST3.objectExpression(
58387
+ return AST4.objectExpression(
58464
58388
  Object.entries(value).filter(([key, value2]) => typeof value2 !== "undefined").map(([key, val]) => {
58465
- return AST3.objectProperty(AST3.stringLiteral(key), serializeValue(val));
58389
+ return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
58466
58390
  })
58467
58391
  );
58468
58392
  }
58469
58393
  if (typeof value === "string") {
58470
58394
  if (value.indexOf("\n") !== -1) {
58471
- return AST3.templateLiteral(
58472
- [AST3.templateElement({ raw: value, cooked: value }, true)],
58395
+ return AST4.templateLiteral(
58396
+ [AST4.templateElement({ raw: value, cooked: value }, true)],
58473
58397
  []
58474
58398
  );
58475
58399
  }
58476
- return AST3.stringLiteral(value);
58400
+ return AST4.stringLiteral(value);
58477
58401
  }
58478
- return AST3.literal(value);
58402
+ return AST4.literal(value);
58479
58403
  }
58480
58404
  function convertValue(config, val) {
58481
58405
  let value;
58482
58406
  let kind;
58483
- if (val.kind === graphql9.Kind.INT) {
58407
+ if (val.kind === graphql10.Kind.INT) {
58484
58408
  value = parseInt(val.value, 10);
58485
58409
  kind = "Int";
58486
- } else if (val.kind === graphql9.Kind.FLOAT) {
58410
+ } else if (val.kind === graphql10.Kind.FLOAT) {
58487
58411
  value = parseFloat(val.value);
58488
58412
  kind = "Float";
58489
- } else if (val.kind === graphql9.Kind.BOOLEAN) {
58413
+ } else if (val.kind === graphql10.Kind.BOOLEAN) {
58490
58414
  value = val.value;
58491
58415
  kind = "Boolean";
58492
- } else if (val.kind === graphql9.Kind.VARIABLE) {
58416
+ } else if (val.kind === graphql10.Kind.VARIABLE) {
58493
58417
  value = val.name.value;
58494
58418
  kind = "Variable";
58495
- } else if (val.kind === graphql9.Kind.STRING) {
58419
+ } else if (val.kind === graphql10.Kind.STRING) {
58496
58420
  value = val.value;
58497
58421
  kind = "String";
58498
58422
  }
@@ -58505,7 +58429,7 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58505
58429
  return {};
58506
58430
  }
58507
58431
  const pathOperations = {};
58508
- graphql10.visit(definition, {
58432
+ graphql11.visit(definition, {
58509
58433
  FragmentSpread(node, _, __, ___, ancestors) {
58510
58434
  if (!config.isListFragment(node.name.value)) {
58511
58435
  return;
@@ -58664,19 +58588,19 @@ function ancestorKey(ancestors) {
58664
58588
  }
58665
58589
 
58666
58590
  // src/codegen/generators/artifacts/selection.ts
58667
- var graphql15 = __toESM(require("graphql"), 1);
58591
+ var graphql16 = __toESM(require("graphql"), 1);
58668
58592
 
58669
58593
  // src/codegen/transforms/list.ts
58670
- var graphql13 = __toESM(require("graphql"), 1);
58594
+ var graphql14 = __toESM(require("graphql"), 1);
58671
58595
 
58672
58596
  // src/codegen/utils/objectIdentificationSelection.ts
58673
- var graphql11 = __toESM(require("graphql"), 1);
58597
+ var graphql12 = __toESM(require("graphql"), 1);
58674
58598
  var objectIdentificationSelection = (config, type) => {
58675
58599
  return config.keyFieldsForType(type.name).map((key) => {
58676
58600
  return {
58677
- kind: graphql11.Kind.FIELD,
58601
+ kind: graphql12.Kind.FIELD,
58678
58602
  name: {
58679
- kind: graphql11.Kind.NAME,
58603
+ kind: graphql12.Kind.NAME,
58680
58604
  value: key
58681
58605
  }
58682
58606
  };
@@ -58684,7 +58608,7 @@ var objectIdentificationSelection = (config, type) => {
58684
58608
  };
58685
58609
 
58686
58610
  // src/codegen/transforms/paginate.ts
58687
- var graphql12 = __toESM(require("graphql"), 1);
58611
+ var graphql13 = __toESM(require("graphql"), 1);
58688
58612
  async function paginate(config, documents) {
58689
58613
  const newDocs = [];
58690
58614
  for (const doc of documents) {
@@ -58717,7 +58641,7 @@ async function paginate(config, documents) {
58717
58641
  };
58718
58642
  let cursorType = "String";
58719
58643
  let paginationPath = [];
58720
- doc.document = graphql12.visit(doc.document, {
58644
+ doc.document = graphql13.visit(doc.document, {
58721
58645
  Field(node, _, __, ___, ancestors) {
58722
58646
  const paginateDirective = node.directives?.find(
58723
58647
  (directive) => directive.name.value === config.paginateDirective
@@ -58743,7 +58667,7 @@ async function paginate(config, documents) {
58743
58667
  flags.offset.enabled = offsetPagination;
58744
58668
  flags.limit.enabled = offsetPagination;
58745
58669
  paginationPath = ancestors.filter(
58746
- (ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql12.Kind.FIELD
58670
+ (ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql13.Kind.FIELD
58747
58671
  ).concat(node).map((field) => field.alias?.value || field.name.value);
58748
58672
  return {
58749
58673
  ...node,
@@ -58762,7 +58686,7 @@ async function paginate(config, documents) {
58762
58686
  let fragment2 = "";
58763
58687
  let paginateMode = config.defaultPaginateMode;
58764
58688
  const requiredArgs = [];
58765
- doc.document = graphql12.visit(doc.document, {
58689
+ doc.document = graphql13.visit(doc.document, {
58766
58690
  OperationDefinition(node) {
58767
58691
  if (node.operation !== "query") {
58768
58692
  throw new HoudiniError({
@@ -58821,9 +58745,9 @@ async function paginate(config, documents) {
58821
58745
  directives: [
58822
58746
  ...node.directives || [],
58823
58747
  {
58824
- kind: graphql12.Kind.DIRECTIVE,
58748
+ kind: graphql13.Kind.DIRECTIVE,
58825
58749
  name: {
58826
- kind: graphql12.Kind.NAME,
58750
+ kind: graphql13.Kind.NAME,
58827
58751
  value: config.argumentsDirective
58828
58752
  }
58829
58753
  }
@@ -58893,22 +58817,22 @@ async function paginate(config, documents) {
58893
58817
  const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
58894
58818
  const fragmentSpreadSelection = [
58895
58819
  {
58896
- kind: graphql12.Kind.FRAGMENT_SPREAD,
58820
+ kind: graphql13.Kind.FRAGMENT_SPREAD,
58897
58821
  name: {
58898
- kind: graphql12.Kind.NAME,
58822
+ kind: graphql13.Kind.NAME,
58899
58823
  value: fragmentName
58900
58824
  },
58901
58825
  directives: [
58902
58826
  {
58903
- kind: graphql12.Kind.DIRECTIVE,
58827
+ kind: graphql13.Kind.DIRECTIVE,
58904
58828
  name: {
58905
- kind: graphql12.Kind.NAME,
58829
+ kind: graphql13.Kind.NAME,
58906
58830
  value: config.withDirective
58907
58831
  },
58908
58832
  ["arguments"]: requiredArgs.map((arg) => variableAsArgument(arg.name)).concat(paginationArgs.map(({ name }) => variableAsArgument(name)))
58909
58833
  },
58910
58834
  {
58911
- kind: graphql12.Kind.DIRECTIVE,
58835
+ kind: graphql13.Kind.DIRECTIVE,
58912
58836
  name: {
58913
58837
  kind: "Name",
58914
58838
  value: config.maskDisableDirective
@@ -58935,23 +58859,23 @@ async function paginate(config, documents) {
58935
58859
  });
58936
58860
  const typeConfig = config.typeConfig?.[fragment2];
58937
58861
  const queryDoc = {
58938
- kind: graphql12.Kind.DOCUMENT,
58862
+ kind: graphql13.Kind.DOCUMENT,
58939
58863
  definitions: [
58940
58864
  {
58941
- kind: graphql12.Kind.OPERATION_DEFINITION,
58865
+ kind: graphql13.Kind.OPERATION_DEFINITION,
58942
58866
  name: {
58943
- kind: graphql12.Kind.NAME,
58867
+ kind: graphql13.Kind.NAME,
58944
58868
  value: refetchQueryName
58945
58869
  },
58946
58870
  operation: "query",
58947
58871
  variableDefinitions: requiredArgs.map(
58948
58872
  (arg) => ({
58949
- kind: graphql12.Kind.VARIABLE_DEFINITION,
58873
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
58950
58874
  type: arg.type,
58951
58875
  variable: {
58952
- kind: graphql12.Kind.VARIABLE,
58876
+ kind: graphql13.Kind.VARIABLE,
58953
58877
  name: {
58954
- kind: graphql12.Kind.NAME,
58878
+ kind: graphql13.Kind.NAME,
58955
58879
  value: arg.name
58956
58880
  }
58957
58881
  }
@@ -58959,18 +58883,18 @@ async function paginate(config, documents) {
58959
58883
  ).concat(
58960
58884
  paginationArgs.map(
58961
58885
  (arg) => ({
58962
- kind: graphql12.Kind.VARIABLE_DEFINITION,
58886
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
58963
58887
  type: {
58964
- kind: graphql12.Kind.NAMED_TYPE,
58888
+ kind: graphql13.Kind.NAMED_TYPE,
58965
58889
  name: {
58966
- kind: graphql12.Kind.NAME,
58890
+ kind: graphql13.Kind.NAME,
58967
58891
  value: arg.type
58968
58892
  }
58969
58893
  },
58970
58894
  variable: {
58971
- kind: graphql12.Kind.VARIABLE,
58895
+ kind: graphql13.Kind.VARIABLE,
58972
58896
  name: {
58973
- kind: graphql12.Kind.NAME,
58897
+ kind: graphql13.Kind.NAME,
58974
58898
  value: arg.name
58975
58899
  }
58976
58900
  },
@@ -58982,12 +58906,12 @@ async function paginate(config, documents) {
58982
58906
  ).concat(
58983
58907
  !nodeQuery ? [] : keys2.map(
58984
58908
  (key) => ({
58985
- kind: graphql12.Kind.VARIABLE_DEFINITION,
58909
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
58986
58910
  type: key.type,
58987
58911
  variable: {
58988
- kind: graphql12.Kind.VARIABLE,
58912
+ kind: graphql13.Kind.VARIABLE,
58989
58913
  name: {
58990
- kind: graphql12.Kind.NAME,
58914
+ kind: graphql13.Kind.NAME,
58991
58915
  value: key.name
58992
58916
  }
58993
58917
  }
@@ -58996,42 +58920,42 @@ async function paginate(config, documents) {
58996
58920
  )
58997
58921
  ),
58998
58922
  selectionSet: {
58999
- kind: graphql12.Kind.SELECTION_SET,
58923
+ kind: graphql13.Kind.SELECTION_SET,
59000
58924
  selections: !nodeQuery ? fragmentSpreadSelection : [
59001
58925
  {
59002
- kind: graphql12.Kind.FIELD,
58926
+ kind: graphql13.Kind.FIELD,
59003
58927
  name: {
59004
- kind: graphql12.Kind.NAME,
58928
+ kind: graphql13.Kind.NAME,
59005
58929
  value: typeConfig?.resolve?.queryField || "node"
59006
58930
  },
59007
58931
  ["arguments"]: keys2.map((key) => ({
59008
- kind: graphql12.Kind.ARGUMENT,
58932
+ kind: graphql13.Kind.ARGUMENT,
59009
58933
  name: {
59010
- kind: graphql12.Kind.NAME,
58934
+ kind: graphql13.Kind.NAME,
59011
58935
  value: key.name
59012
58936
  },
59013
58937
  value: {
59014
- kind: graphql12.Kind.VARIABLE,
58938
+ kind: graphql13.Kind.VARIABLE,
59015
58939
  name: {
59016
- kind: graphql12.Kind.NAME,
58940
+ kind: graphql13.Kind.NAME,
59017
58941
  value: key.name
59018
58942
  }
59019
58943
  }
59020
58944
  })),
59021
58945
  selectionSet: {
59022
- kind: graphql12.Kind.SELECTION_SET,
58946
+ kind: graphql13.Kind.SELECTION_SET,
59023
58947
  selections: [
59024
58948
  {
59025
- kind: graphql12.Kind.FIELD,
58949
+ kind: graphql13.Kind.FIELD,
59026
58950
  name: {
59027
- kind: graphql12.Kind.NAME,
58951
+ kind: graphql13.Kind.NAME,
59028
58952
  value: "__typename"
59029
58953
  }
59030
58954
  },
59031
58955
  ...(typeConfig?.keys || [config.defaultKeys[0]]).map((key) => ({
59032
- kind: graphql12.Kind.FIELD,
58956
+ kind: graphql13.Kind.FIELD,
59033
58957
  name: {
59034
- kind: graphql12.Kind.NAME,
58958
+ kind: graphql13.Kind.NAME,
59035
58959
  value: key
59036
58960
  }
59037
58961
  })),
@@ -59088,15 +59012,15 @@ function replaceArgumentsWithVariables(args, flags) {
59088
59012
  }
59089
59013
  function variableAsArgument(name, variable) {
59090
59014
  return {
59091
- kind: graphql12.Kind.ARGUMENT,
59015
+ kind: graphql13.Kind.ARGUMENT,
59092
59016
  name: {
59093
- kind: graphql12.Kind.NAME,
59017
+ kind: graphql13.Kind.NAME,
59094
59018
  value: name
59095
59019
  },
59096
59020
  value: {
59097
- kind: graphql12.Kind.VARIABLE,
59021
+ kind: graphql13.Kind.VARIABLE,
59098
59022
  name: {
59099
- kind: graphql12.Kind.NAME,
59023
+ kind: graphql13.Kind.NAME,
59100
59024
  value: variable ?? name
59101
59025
  }
59102
59026
  }
@@ -59104,18 +59028,18 @@ function variableAsArgument(name, variable) {
59104
59028
  }
59105
59029
  function staticVariableDefinition(name, type, defaultValue, variableName) {
59106
59030
  return {
59107
- kind: graphql12.Kind.VARIABLE_DEFINITION,
59031
+ kind: graphql13.Kind.VARIABLE_DEFINITION,
59108
59032
  type: {
59109
- kind: graphql12.Kind.NAMED_TYPE,
59033
+ kind: graphql13.Kind.NAMED_TYPE,
59110
59034
  name: {
59111
- kind: graphql12.Kind.NAME,
59035
+ kind: graphql13.Kind.NAME,
59112
59036
  value: type
59113
59037
  }
59114
59038
  },
59115
59039
  variable: {
59116
- kind: graphql12.Kind.VARIABLE,
59040
+ kind: graphql13.Kind.VARIABLE,
59117
59041
  name: {
59118
- kind: graphql12.Kind.NAME,
59042
+ kind: graphql13.Kind.NAME,
59119
59043
  value: variableName ?? name
59120
59044
  }
59121
59045
  },
@@ -59127,9 +59051,9 @@ function staticVariableDefinition(name, type, defaultValue, variableName) {
59127
59051
  }
59128
59052
  function argumentNode(name, value) {
59129
59053
  return {
59130
- kind: graphql12.Kind.ARGUMENT,
59054
+ kind: graphql13.Kind.ARGUMENT,
59131
59055
  name: {
59132
- kind: graphql12.Kind.NAME,
59056
+ kind: graphql13.Kind.NAME,
59133
59057
  value: name
59134
59058
  },
59135
59059
  value: objectNode(value)
@@ -59137,16 +59061,16 @@ function argumentNode(name, value) {
59137
59061
  }
59138
59062
  function objectNode([type, defaultValue]) {
59139
59063
  const node = {
59140
- kind: graphql12.Kind.OBJECT,
59064
+ kind: graphql13.Kind.OBJECT,
59141
59065
  fields: [
59142
59066
  {
59143
- kind: graphql12.Kind.OBJECT_FIELD,
59067
+ kind: graphql13.Kind.OBJECT_FIELD,
59144
59068
  name: {
59145
- kind: graphql12.Kind.NAME,
59069
+ kind: graphql13.Kind.NAME,
59146
59070
  value: "type"
59147
59071
  },
59148
59072
  value: {
59149
- kind: graphql12.Kind.STRING,
59073
+ kind: graphql13.Kind.STRING,
59150
59074
  value: type
59151
59075
  }
59152
59076
  }
@@ -59154,8 +59078,8 @@ function objectNode([type, defaultValue]) {
59154
59078
  };
59155
59079
  if (defaultValue) {
59156
59080
  node.fields.push({
59157
- kind: graphql12.Kind.OBJECT_FIELD,
59158
- name: { kind: graphql12.Kind.NAME, value: "default" },
59081
+ kind: graphql13.Kind.OBJECT_FIELD,
59082
+ name: { kind: graphql13.Kind.NAME, value: "default" },
59159
59083
  value: {
59160
59084
  kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
59161
59085
  value: defaultValue.toString()
@@ -59166,34 +59090,34 @@ function objectNode([type, defaultValue]) {
59166
59090
  }
59167
59091
  var pageInfoSelection = [
59168
59092
  {
59169
- kind: graphql12.Kind.FIELD,
59093
+ kind: graphql13.Kind.FIELD,
59170
59094
  name: {
59171
- kind: graphql12.Kind.NAME,
59095
+ kind: graphql13.Kind.NAME,
59172
59096
  value: "edges"
59173
59097
  },
59174
59098
  selectionSet: {
59175
- kind: graphql12.Kind.SELECTION_SET,
59099
+ kind: graphql13.Kind.SELECTION_SET,
59176
59100
  selections: [
59177
59101
  {
59178
- kind: graphql12.Kind.FIELD,
59102
+ kind: graphql13.Kind.FIELD,
59179
59103
  name: {
59180
- kind: graphql12.Kind.NAME,
59104
+ kind: graphql13.Kind.NAME,
59181
59105
  value: "cursor"
59182
59106
  }
59183
59107
  },
59184
59108
  {
59185
- kind: graphql12.Kind.FIELD,
59109
+ kind: graphql13.Kind.FIELD,
59186
59110
  name: {
59187
- kind: graphql12.Kind.NAME,
59111
+ kind: graphql13.Kind.NAME,
59188
59112
  value: "node"
59189
59113
  },
59190
59114
  selectionSet: {
59191
- kind: graphql12.Kind.SELECTION_SET,
59115
+ kind: graphql13.Kind.SELECTION_SET,
59192
59116
  selections: [
59193
59117
  {
59194
- kind: graphql12.Kind.FIELD,
59118
+ kind: graphql13.Kind.FIELD,
59195
59119
  name: {
59196
- kind: graphql12.Kind.NAME,
59120
+ kind: graphql13.Kind.NAME,
59197
59121
  value: "__typename"
59198
59122
  }
59199
59123
  }
@@ -59204,39 +59128,39 @@ var pageInfoSelection = [
59204
59128
  }
59205
59129
  },
59206
59130
  {
59207
- kind: graphql12.Kind.FIELD,
59131
+ kind: graphql13.Kind.FIELD,
59208
59132
  name: {
59209
- kind: graphql12.Kind.NAME,
59133
+ kind: graphql13.Kind.NAME,
59210
59134
  value: "pageInfo"
59211
59135
  },
59212
59136
  selectionSet: {
59213
- kind: graphql12.Kind.SELECTION_SET,
59137
+ kind: graphql13.Kind.SELECTION_SET,
59214
59138
  selections: [
59215
59139
  {
59216
- kind: graphql12.Kind.FIELD,
59140
+ kind: graphql13.Kind.FIELD,
59217
59141
  name: {
59218
- kind: graphql12.Kind.NAME,
59142
+ kind: graphql13.Kind.NAME,
59219
59143
  value: "hasPreviousPage"
59220
59144
  }
59221
59145
  },
59222
59146
  {
59223
- kind: graphql12.Kind.FIELD,
59147
+ kind: graphql13.Kind.FIELD,
59224
59148
  name: {
59225
- kind: graphql12.Kind.NAME,
59149
+ kind: graphql13.Kind.NAME,
59226
59150
  value: "hasNextPage"
59227
59151
  }
59228
59152
  },
59229
59153
  {
59230
- kind: graphql12.Kind.FIELD,
59154
+ kind: graphql13.Kind.FIELD,
59231
59155
  name: {
59232
- kind: graphql12.Kind.NAME,
59156
+ kind: graphql13.Kind.NAME,
59233
59157
  value: "startCursor"
59234
59158
  }
59235
59159
  },
59236
59160
  {
59237
- kind: graphql12.Kind.FIELD,
59161
+ kind: graphql13.Kind.FIELD,
59238
59162
  name: {
59239
- kind: graphql12.Kind.NAME,
59163
+ kind: graphql13.Kind.NAME,
59240
59164
  value: "endCursor"
59241
59165
  }
59242
59166
  }
@@ -59250,17 +59174,17 @@ async function addListFragments(config, documents) {
59250
59174
  const lists = {};
59251
59175
  const errors = [];
59252
59176
  for (const doc of documents) {
59253
- doc.document = graphql13.visit(doc.document, {
59177
+ doc.document = graphql14.visit(doc.document, {
59254
59178
  Directive(node, key, parent2, path2, ancestors) {
59255
59179
  if ([config.listDirective, config.paginateDirective].includes(node.name.value)) {
59256
59180
  const nameArg = node.arguments?.find(
59257
59181
  (arg) => arg.name.value === config.listOrPaginateNameArg
59258
59182
  );
59259
59183
  let error = {
59260
- ...new graphql13.GraphQLError(
59184
+ ...new graphql14.GraphQLError(
59261
59185
  "",
59262
59186
  node,
59263
- new graphql13.Source(""),
59187
+ new graphql14.Source(""),
59264
59188
  node.loc ? [node.loc.start, node.loc.end] : null,
59265
59189
  path2
59266
59190
  ),
@@ -59312,7 +59236,7 @@ async function addListFragments(config, documents) {
59312
59236
  {
59313
59237
  kind: "Argument",
59314
59238
  name: {
59315
- kind: graphql13.Kind.NAME,
59239
+ kind: graphql14.Kind.NAME,
59316
59240
  value: "connection"
59317
59241
  },
59318
59242
  value: {
@@ -59362,7 +59286,7 @@ async function addListFragments(config, documents) {
59362
59286
  const validDeletes = [
59363
59287
  ...new Set(
59364
59288
  Object.values(lists).map(({ type }) => {
59365
- if (!(type instanceof graphql13.GraphQLObjectType)) {
59289
+ if (!(type instanceof graphql14.GraphQLObjectType)) {
59366
59290
  return "";
59367
59291
  }
59368
59292
  if (config.keyFieldsForType(type.name).length !== 1) {
@@ -59376,7 +59300,7 @@ async function addListFragments(config, documents) {
59376
59300
  return;
59377
59301
  }
59378
59302
  const generatedDoc = {
59379
- kind: graphql13.Kind.DOCUMENT,
59303
+ kind: graphql14.Kind.DOCUMENT,
59380
59304
  definitions: Object.entries(lists).flatMap(
59381
59305
  ([name, { selection, type }]) => {
59382
59306
  const schemaType = config.schema.getType(type.name);
@@ -59384,7 +59308,7 @@ async function addListFragments(config, documents) {
59384
59308
  throw new HoudiniError({ message: "Lists must have a selection" });
59385
59309
  }
59386
59310
  const fragmentSelection = {
59387
- kind: graphql13.Kind.SELECTION_SET,
59311
+ kind: graphql14.Kind.SELECTION_SET,
59388
59312
  selections: [...selection.selections]
59389
59313
  };
59390
59314
  if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
@@ -59399,14 +59323,14 @@ async function addListFragments(config, documents) {
59399
59323
  {
59400
59324
  name: {
59401
59325
  value: config.listInsertFragment(name),
59402
- kind: graphql13.Kind.NAME
59326
+ kind: graphql14.Kind.NAME
59403
59327
  },
59404
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
59328
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
59405
59329
  selectionSet: fragmentSelection,
59406
59330
  typeCondition: {
59407
- kind: graphql13.Kind.NAMED_TYPE,
59331
+ kind: graphql14.Kind.NAMED_TYPE,
59408
59332
  name: {
59409
- kind: graphql13.Kind.NAME,
59333
+ kind: graphql14.Kind.NAME,
59410
59334
  value: type.name
59411
59335
  }
59412
59336
  }
@@ -59414,32 +59338,32 @@ async function addListFragments(config, documents) {
59414
59338
  {
59415
59339
  name: {
59416
59340
  value: config.listToggleFragment(name),
59417
- kind: graphql13.Kind.NAME
59341
+ kind: graphql14.Kind.NAME
59418
59342
  },
59419
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
59343
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
59420
59344
  selectionSet: fragmentSelection,
59421
59345
  typeCondition: {
59422
- kind: graphql13.Kind.NAMED_TYPE,
59346
+ kind: graphql14.Kind.NAMED_TYPE,
59423
59347
  name: {
59424
- kind: graphql13.Kind.NAME,
59348
+ kind: graphql14.Kind.NAME,
59425
59349
  value: type.name
59426
59350
  }
59427
59351
  }
59428
59352
  },
59429
59353
  {
59430
- kind: graphql13.Kind.FRAGMENT_DEFINITION,
59354
+ kind: graphql14.Kind.FRAGMENT_DEFINITION,
59431
59355
  name: {
59432
59356
  value: config.listRemoveFragment(name),
59433
- kind: graphql13.Kind.NAME
59357
+ kind: graphql14.Kind.NAME
59434
59358
  },
59435
59359
  selectionSet: {
59436
- kind: graphql13.Kind.SELECTION_SET,
59360
+ kind: graphql14.Kind.SELECTION_SET,
59437
59361
  selections: [...objectIdentificationSelection(config, type)]
59438
59362
  },
59439
59363
  typeCondition: {
59440
- kind: graphql13.Kind.NAMED_TYPE,
59364
+ kind: graphql14.Kind.NAMED_TYPE,
59441
59365
  name: {
59442
- kind: graphql13.Kind.NAME,
59366
+ kind: graphql14.Kind.NAME,
59443
59367
  value: type.name
59444
59368
  }
59445
59369
  }
@@ -59448,14 +59372,14 @@ async function addListFragments(config, documents) {
59448
59372
  }
59449
59373
  ).concat(
59450
59374
  ...validDeletes.map((typeName) => ({
59451
- kind: graphql13.Kind.DIRECTIVE_DEFINITION,
59375
+ kind: graphql14.Kind.DIRECTIVE_DEFINITION,
59452
59376
  name: {
59453
- kind: graphql13.Kind.NAME,
59377
+ kind: graphql14.Kind.NAME,
59454
59378
  value: config.listDeleteDirective(typeName)
59455
59379
  },
59456
59380
  locations: [
59457
59381
  {
59458
- kind: graphql13.Kind.NAME,
59382
+ kind: graphql14.Kind.NAME,
59459
59383
  value: "FIELD"
59460
59384
  }
59461
59385
  ],
@@ -59463,8 +59387,8 @@ async function addListFragments(config, documents) {
59463
59387
  }))
59464
59388
  )
59465
59389
  };
59466
- config.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql13.print).join("\n\n");
59467
- config.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql13.print).join("\n\n");
59390
+ config.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql14.print).join("\n\n");
59391
+ config.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql14.print).join("\n\n");
59468
59392
  documents.push({
59469
59393
  name: "generated::lists",
59470
59394
  kind: ArtifactKind.Fragment,
@@ -59550,11 +59474,11 @@ var nodeNotDefinedMessage = (config) => `Looks like you are trying to use the ${
59550
59474
  For more information, visit this link: ${siteURL}/guides/pagination`;
59551
59475
 
59552
59476
  // src/codegen/generators/artifacts/fieldKey.ts
59553
- var graphql14 = __toESM(require("graphql"), 1);
59477
+ var graphql15 = __toESM(require("graphql"), 1);
59554
59478
  function fieldKey(config, field) {
59555
59479
  const attributeName = field.alias?.value || field.name.value;
59556
- const printed = graphql14.print(field);
59557
- const secondParse = graphql14.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
59480
+ const printed = graphql15.print(field);
59481
+ const secondParse = graphql15.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
59558
59482
  let paginateMode = config.defaultPaginateMode;
59559
59483
  const paginatedDirective = field.directives?.find(
59560
59484
  (directive) => directive.name.value === config.paginateDirective
@@ -59677,13 +59601,13 @@ function prepareSelection({
59677
59601
  } else if ("getFields" in type) {
59678
59602
  let typeRef = type.getFields()[field.name.value].type;
59679
59603
  fieldType = getRootType(typeRef);
59680
- nullable = !graphql15.isNonNullType(typeRef);
59681
- } else if (graphql15.isAbstractType(type)) {
59604
+ nullable = !graphql16.isNonNullType(typeRef);
59605
+ } else if (graphql16.isAbstractType(type)) {
59682
59606
  for (const possible of config.schema.getPossibleTypes(type)) {
59683
- if (graphql15.isObjectType(possible)) {
59607
+ if (graphql16.isObjectType(possible)) {
59684
59608
  if (possible.getFields()[field.name.value]) {
59685
59609
  fieldType = possible.getFields()[field.name.value].type;
59686
- nullable = !graphql15.isNonNullType(fieldType);
59610
+ nullable = !graphql16.isNonNullType(fieldType);
59687
59611
  break;
59688
59612
  }
59689
59613
  }
@@ -59820,7 +59744,7 @@ function prepareSelection({
59820
59744
  kind: "value"
59821
59745
  } : { kind: "continue" };
59822
59746
  const parentType = config.schema.getType(rootType);
59823
- if (graphql15.isObjectType(parentType) || graphql15.isInterfaceType(parentType)) {
59747
+ if (graphql16.isObjectType(parentType) || graphql16.isInterfaceType(parentType)) {
59824
59748
  const fieldType2 = parentType.getFields()[field.name.value]?.type;
59825
59749
  if (fieldType2) {
59826
59750
  const listCount = unwrapType(config, fieldType2).wrappers.filter(
@@ -59843,7 +59767,7 @@ function prepareSelection({
59843
59767
  }
59844
59768
  fieldObj.loading = loadingValue;
59845
59769
  }
59846
- if (graphql15.isInterfaceType(fieldType) || graphql15.isUnionType(fieldType)) {
59770
+ if (graphql16.isInterfaceType(fieldType) || graphql16.isUnionType(fieldType)) {
59847
59771
  fieldObj.abstract = true;
59848
59772
  if (Object.values(fieldObj.selection?.abstractFields?.fields ?? {}).some(
59849
59773
  (fields) => Object.values(fields ?? {}).some((field2) => field2.required)
@@ -59925,7 +59849,7 @@ function mergeSelection({
59925
59849
  typeSelection,
59926
59850
  abstractSelection.fields[typeName] ?? {}
59927
59851
  );
59928
- if (graphql15.isAbstractType(gqlType)) {
59852
+ if (graphql16.isAbstractType(gqlType)) {
59929
59853
  for (const possible of config.schema.getPossibleTypes(gqlType)) {
59930
59854
  if (!possibleSelectionTypes[typeName]) {
59931
59855
  possibleSelectionTypes[typeName] = [];
@@ -59960,7 +59884,7 @@ function mergeSelection({
59960
59884
  }
59961
59885
  }
59962
59886
  const parentType = config.schema.getType(rootType);
59963
- const possibleParents = graphql15.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t2) => t2.name) : [parentType.name];
59887
+ const possibleParents = graphql16.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t2) => t2.name) : [parentType.name];
59964
59888
  for (const key of Object.keys(abstractSelection.typeMap)) {
59965
59889
  if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
59966
59890
  delete abstractSelection.typeMap[key];
@@ -60017,12 +59941,12 @@ function mergeSelection({
60017
59941
  }
60018
59942
 
60019
59943
  // src/codegen/generators/artifacts/index.ts
60020
- var AST4 = recast4.types.builders;
59944
+ var AST5 = recast5.types.builders;
60021
59945
  function artifactGenerator(stats) {
60022
59946
  return async function(config, docs) {
60023
59947
  const filterTypes = {};
60024
59948
  for (const doc of docs) {
60025
- graphql16.visit(doc.document, {
59949
+ graphql17.visit(doc.document, {
60026
59950
  Directive(node, _, __, ___, ancestors) {
60027
59951
  if (node.name.value !== config.listDirective) {
60028
59952
  return;
@@ -60082,7 +60006,7 @@ function artifactGenerator(stats) {
60082
60006
  return;
60083
60007
  }
60084
60008
  const usedVariableNames = /* @__PURE__ */ new Set();
60085
- let documentWithoutInternalDirectives = graphql16.visit(document, {
60009
+ let documentWithoutInternalDirectives = graphql17.visit(document, {
60086
60010
  Directive(node) {
60087
60011
  if (config.isInternalDirective(node.name.value)) {
60088
60012
  return null;
@@ -60095,7 +60019,7 @@ function artifactGenerator(stats) {
60095
60019
  }
60096
60020
  }
60097
60021
  });
60098
- let documentWithoutExtraVariables = graphql16.visit(
60022
+ let documentWithoutExtraVariables = graphql17.visit(
60099
60023
  documentWithoutInternalDirectives,
60100
60024
  {
60101
60025
  VariableDefinition(variableDefinitionNode) {
@@ -60106,13 +60030,13 @@ function artifactGenerator(stats) {
60106
60030
  }
60107
60031
  }
60108
60032
  );
60109
- let rawString = graphql16.print(documentWithoutExtraVariables);
60033
+ let rawString = graphql17.print(documentWithoutExtraVariables);
60110
60034
  let docKind = doc.kind;
60111
60035
  const operations = document.definitions.filter(
60112
- ({ kind }) => kind === graphql16.Kind.OPERATION_DEFINITION
60036
+ ({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
60113
60037
  );
60114
60038
  const fragments = document.definitions.filter(
60115
- ({ kind }) => kind === graphql16.Kind.FRAGMENT_DEFINITION
60039
+ ({ kind }) => kind === graphql17.Kind.FRAGMENT_DEFINITION
60116
60040
  );
60117
60041
  let rootType = "";
60118
60042
  let selectionSet;
@@ -60259,7 +60183,21 @@ function artifactGenerator(stats) {
60259
60183
  artifact.pluginData[plugin2.name] = plugin2.artifactData({ config, document: doc }) ?? {};
60260
60184
  }
60261
60185
  if (inputs && inputs.length > 0) {
60262
- artifact.input = inputObject(config, inputs);
60186
+ const runtimeScalars = inputs.reduce((prev, input) => {
60187
+ const runtimeScalarDirective = input.directives?.find(
60188
+ (directive2) => directive2.name.value === config.runtimeScalarDirective
60189
+ );
60190
+ if (!runtimeScalarDirective) {
60191
+ return prev;
60192
+ }
60193
+ return {
60194
+ ...prev,
60195
+ [input.variable.name.value]: runtimeScalarDirective.arguments?.find(
60196
+ (arg) => arg.name.value === "type"
60197
+ )?.value?.value
60198
+ };
60199
+ }, {});
60200
+ artifact.input = inputObject(config, inputs, runtimeScalars);
60263
60201
  }
60264
60202
  if (artifact.kind === "HoudiniQuery") {
60265
60203
  const cacheDirective = operations[0].directives?.find(
@@ -60298,9 +60236,9 @@ function artifactGenerator(stats) {
60298
60236
  plugin2.artifactEnd({ config, document: doc });
60299
60237
  }
60300
60238
  const _houdiniHash = hashOriginal({ document: doc });
60301
- const file = AST4.program([
60239
+ const file = AST5.program([
60302
60240
  moduleExport(config, "default", serializeValue(artifact)),
60303
- AST4.expressionStatement(AST4.stringLiteral(`HoudiniHash=${_houdiniHash}`))
60241
+ AST5.expressionStatement(AST5.stringLiteral(`HoudiniHash=${_houdiniHash}`))
60304
60242
  ]);
60305
60243
  const artifactPath = config.artifactPath(document);
60306
60244
  const countDocument = doc.generateStore;
@@ -60358,7 +60296,7 @@ function applyMask(config, target, mask) {
60358
60296
  if (!targetType) {
60359
60297
  continue;
60360
60298
  }
60361
- if (graphql16.isAbstractType(targetType)) {
60299
+ if (graphql17.isAbstractType(targetType)) {
60362
60300
  for (const possible of config.schema.getPossibleTypes(targetType)) {
60363
60301
  if (target.abstractFields?.fields[possible.name]) {
60364
60302
  applyMask(
@@ -60381,8 +60319,8 @@ function applyMask(config, target, mask) {
60381
60319
  }
60382
60320
 
60383
60321
  // src/codegen/generators/runtime/graphqlFunction.ts
60384
- var recast5 = __toESM(require_main2(), 1);
60385
- var AST5 = recast5.types.builders;
60322
+ var recast6 = __toESM(require_main2(), 1);
60323
+ var AST6 = recast6.types.builders;
60386
60324
  async function generateGraphqlReturnTypes(config, docs) {
60387
60325
  const indexPath = path_exports.join(config.runtimeDirectory, "index.d.ts");
60388
60326
  const fileContent = await fs_exports.readFile(indexPath) || "";
@@ -60417,18 +60355,18 @@ async function generateGraphqlReturnTypes(config, docs) {
60417
60355
  continue;
60418
60356
  }
60419
60357
  for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
60420
- const input = AST5.identifier("str");
60421
- input.typeAnnotation = AST5.tsTypeAnnotation(
60422
- AST5.tsLiteralType(AST5.stringLiteral(queryString))
60358
+ const input = AST6.identifier("str");
60359
+ input.typeAnnotation = AST6.tsTypeAnnotation(
60360
+ AST6.tsLiteralType(AST6.stringLiteral(queryString))
60423
60361
  );
60424
60362
  script.body.splice(
60425
60363
  i,
60426
60364
  0,
60427
- AST5.exportNamedDeclaration(
60428
- AST5.tsDeclareFunction(
60429
- AST5.identifier("graphql"),
60365
+ AST6.exportNamedDeclaration(
60366
+ AST6.tsDeclareFunction(
60367
+ AST6.identifier("graphql"),
60430
60368
  [input],
60431
- AST5.tsTypeAnnotation(AST5.tsTypeReference(AST5.identifier(returnValue)))
60369
+ AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
60432
60370
  )
60433
60371
  )
60434
60372
  );
@@ -60603,165 +60541,22 @@ function moduleStatments(config) {
60603
60541
  var recast11 = __toESM(require_main2(), 1);
60604
60542
 
60605
60543
  // src/codegen/generators/typescript/addReferencedInputTypes.ts
60606
- var graphql19 = __toESM(require("graphql"), 1);
60607
- var recast8 = __toESM(require_main2(), 1);
60608
-
60609
- // src/codegen/generators/typescript/typeReference.ts
60610
60544
  var graphql18 = __toESM(require("graphql"), 1);
60611
60545
  var recast7 = __toESM(require_main2(), 1);
60612
-
60613
- // src/codegen/generators/typescript/types.ts
60614
- var graphql17 = __toESM(require("graphql"), 1);
60615
- var recast6 = __toESM(require_main2(), 1);
60616
- var AST6 = recast6.types.builders;
60617
- function readonlyProperty(prop, enable = true) {
60618
- if (enable) {
60619
- prop.readonly = true;
60620
- }
60621
- return prop;
60622
- }
60623
- function nullableField(inner, input = false) {
60624
- const members = [inner, AST6.tsNullKeyword()];
60625
- if (input) {
60626
- members.push(AST6.tsUndefinedKeyword());
60627
- }
60628
- return AST6.tsUnionType(members);
60629
- }
60630
- function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
60631
- if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
60632
- if (!field) {
60633
- return AST6.tsNeverKeyword();
60634
- }
60635
- const component = config.componentFields[field.parent][field.field];
60636
- const sourcePathRelative = path_exports.relative(
60637
- path_exports.join(config.projectRoot, "src"),
60638
- component.filepath
60639
- );
60640
- let sourcePathParsed = path_exports.parse(sourcePathRelative);
60641
- let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
60642
- const localImport = ensureImports({
60643
- config,
60644
- body,
60645
- import: "__component__" + component.fragment,
60646
- sourceModule: path_exports.join(
60647
- path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
60648
- "src",
60649
- sourcePath
60650
- )
60651
- });
60652
- const parameters = AST6.tsTypeReference(AST6.identifier("Parameters"));
60653
- parameters.typeParameters = AST6.tsTypeParameterInstantiation([
60654
- AST6.tsTypeQuery(AST6.identifier(localImport))
60655
- ]);
60656
- const indexed = AST6.tsIndexedAccessType(
60657
- parameters,
60658
- AST6.tsLiteralType(AST6.numericLiteral(0))
60659
- );
60660
- const omit = AST6.tsTypeReference(AST6.identifier("Omit"));
60661
- omit.typeParameters = AST6.tsTypeParameterInstantiation([
60662
- indexed,
60663
- AST6.tsLiteralType(AST6.stringLiteral(component.prop))
60664
- ]);
60665
- const arg = AST6.identifier("props");
60666
- arg.typeAnnotation = AST6.tsTypeAnnotation(omit);
60667
- const returnType = AST6.tsTypeReference(AST6.identifier("ReturnType"));
60668
- returnType.typeParameters = AST6.tsTypeParameterInstantiation([
60669
- AST6.tsTypeQuery(AST6.identifier(localImport))
60670
- ]);
60671
- const fnType = AST6.tsFunctionType([arg]);
60672
- fnType.typeAnnotation = AST6.tsTypeAnnotation(returnType);
60673
- return fnType;
60674
- }
60675
- switch (target.name) {
60676
- case "String": {
60677
- return AST6.tsStringKeyword();
60678
- }
60679
- case "Int": {
60680
- return AST6.tsNumberKeyword();
60681
- }
60682
- case "Float": {
60683
- return AST6.tsNumberKeyword();
60684
- }
60685
- case "Boolean": {
60686
- return AST6.tsBooleanKeyword();
60687
- }
60688
- case "ID": {
60689
- return AST6.tsStringKeyword();
60690
- }
60691
- default: {
60692
- if (graphql17.isNonNullType(target) && "ofType" in target) {
60693
- return scalarPropertyValue(
60694
- config,
60695
- filepath,
60696
- missingScalars,
60697
- target.ofType,
60698
- body,
60699
- field
60700
- );
60701
- }
60702
- if (config.scalars?.[target.name]) {
60703
- return AST6.tsTypeReference(AST6.identifier(config.scalars?.[target.name].type));
60704
- }
60705
- if (target.name !== config.componentScalar) {
60706
- missingScalars.add(target.name);
60707
- }
60708
- return AST6.tsAnyKeyword();
60709
- }
60710
- }
60711
- }
60712
-
60713
- // src/codegen/generators/typescript/typeReference.ts
60714
60546
  var AST7 = recast7.types.builders;
60715
- function tsTypeReference(config, filepath, missingScalars, definition, body) {
60716
- const { type, wrappers } = unwrapType(config, definition.type);
60717
- let result;
60718
- if (graphql18.isScalarType(type)) {
60719
- result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
60720
- } else if (graphql18.isEnumType(type)) {
60721
- result = enumReference(config, body, type.name);
60722
- } else {
60723
- result = AST7.tsTypeReference(AST7.identifier(type.name));
60724
- }
60725
- for (const toWrap of wrappers) {
60726
- if (toWrap === "NonNull" /* NonNull */) {
60727
- continue;
60728
- } else if (toWrap === "Nullable" /* Nullable */) {
60729
- result = nullableField(result, true);
60730
- } else if (toWrap === "List" /* List */) {
60731
- result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
60732
- }
60733
- }
60734
- return result;
60735
- }
60736
- function enumReference(config, body, name) {
60737
- ensureImports({
60738
- config,
60739
- body,
60740
- import: ["ValueOf"],
60741
- importKind: "type",
60742
- sourceModule: "$houdini/runtime/lib/types"
60743
- });
60744
- return AST7.tsTypeReference(
60745
- AST7.identifier("ValueOf"),
60746
- AST7.tsTypeParameterInstantiation([AST7.tsTypeQuery(AST7.identifier(name))])
60747
- );
60748
- }
60749
-
60750
- // src/codegen/generators/typescript/addReferencedInputTypes.ts
60751
- var AST8 = recast8.types.builders;
60752
60547
  function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
60753
60548
  const { type } = unwrapType(config, rootType);
60754
- if (graphql19.isScalarType(type)) {
60549
+ if (graphql18.isScalarType(type)) {
60755
60550
  return;
60756
60551
  }
60757
60552
  if (visitedTypes.has(type.name)) {
60758
60553
  return;
60759
60554
  }
60760
- if (graphql19.isUnionType(type)) {
60555
+ if (graphql18.isUnionType(type)) {
60761
60556
  throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
60762
60557
  }
60763
60558
  visitedTypes.add(type.name);
60764
- if (graphql19.isEnumType(type)) {
60559
+ if (graphql18.isEnumType(type)) {
60765
60560
  ensureImports({
60766
60561
  config,
60767
60562
  body,
@@ -60775,21 +60570,37 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
60775
60570
  for (const field of Object.values(type.getFields())) {
60776
60571
  addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
60777
60572
  members.push(
60778
- AST8.tsPropertySignature(
60779
- AST8.identifier(field.name),
60780
- AST8.tsTypeAnnotation(
60573
+ AST7.tsPropertySignature(
60574
+ AST7.identifier(field.name),
60575
+ AST7.tsTypeAnnotation(
60781
60576
  tsTypeReference(config, filepath, missingScalars, field, body)
60782
60577
  ),
60783
- graphql19.isNullableType(field.type)
60578
+ graphql18.isNullableType(field.type)
60784
60579
  )
60785
60580
  );
60786
60581
  }
60787
- body.push(AST8.tsTypeAliasDeclaration(AST8.identifier(type.name), AST8.tsTypeLiteral(members)));
60582
+ body.push(AST7.tsTypeAliasDeclaration(AST7.identifier(type.name), AST7.tsTypeLiteral(members)));
60788
60583
  }
60789
60584
 
60790
60585
  // src/codegen/generators/typescript/inlineType.ts
60791
- var graphql20 = __toESM(require("graphql"), 1);
60586
+ var graphql19 = __toESM(require("graphql"), 1);
60792
60587
  var recast9 = __toESM(require_main2(), 1);
60588
+
60589
+ // src/codegen/generators/comments/jsdoc.ts
60590
+ var recast8 = __toESM(require_main2(), 1);
60591
+ var AST8 = recast8.types.builders;
60592
+ function jsdocComment(text, deprecated) {
60593
+ let commentContent = `*
60594
+ * ${text}
60595
+ `;
60596
+ if (deprecated) {
60597
+ commentContent = `${commentContent} * @deprecated ${deprecated}
60598
+ `;
60599
+ }
60600
+ return AST8.commentBlock(commentContent, true);
60601
+ }
60602
+
60603
+ // src/codegen/generators/typescript/inlineType.ts
60793
60604
  var AST9 = recast9.types.builders;
60794
60605
  var fragmentKey2 = " $fragments";
60795
60606
  function inlineType({
@@ -60810,7 +60621,7 @@ function inlineType({
60810
60621
  const { type, wrappers } = unwrapType(config, rootType);
60811
60622
  let result;
60812
60623
  let forceNullable = false;
60813
- if (graphql20.isScalarType(type)) {
60624
+ if (graphql19.isScalarType(type)) {
60814
60625
  result = scalarPropertyValue(
60815
60626
  config,
60816
60627
  filepath,
@@ -60819,7 +60630,7 @@ function inlineType({
60819
60630
  body,
60820
60631
  field
60821
60632
  );
60822
- } else if (graphql20.isEnumType(type)) {
60633
+ } else if (graphql19.isEnumType(type)) {
60823
60634
  ensureImports({
60824
60635
  config,
60825
60636
  body,
@@ -60844,11 +60655,11 @@ function inlineType({
60844
60655
  for (const selection of selections) {
60845
60656
  if (selection.kind === "InlineFragment" && selection.typeCondition) {
60846
60657
  const fragmentType = config.schema.getType(selection.typeCondition.name.value);
60847
- if (!graphql20.isInterfaceType(type) && !graphql20.isUnionType(type)) {
60658
+ if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
60848
60659
  selectedFields.push(...selection.selectionSet.selections);
60849
60660
  continue;
60850
60661
  }
60851
- if (!graphql20.isInterfaceType(fragmentType) && !graphql20.isUnionType(fragmentType)) {
60662
+ if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
60852
60663
  if (!inlineFragments[fragmentType.name]) {
60853
60664
  inlineFragments[fragmentType.name] = [];
60854
60665
  }
@@ -60940,6 +60751,11 @@ function inlineType({
60940
60751
  if (allOptional) {
60941
60752
  prop.optional = true;
60942
60753
  }
60754
+ if (field2.description || field2.deprecationReason) {
60755
+ prop.comments = [
60756
+ jsdocComment(field2.description ?? "", field2.deprecationReason ?? void 0)
60757
+ ];
60758
+ }
60943
60759
  return prop;
60944
60760
  })
60945
60761
  ]);
@@ -60991,7 +60807,7 @@ function inlineType({
60991
60807
  }
60992
60808
  }
60993
60809
  }
60994
- if (objectType.type === "TSTypeLiteral" && !graphql20.isInterfaceType(fragmentRootType) && !graphql20.isUnionType(fragmentRootType)) {
60810
+ if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
60995
60811
  const existingTypenameIndex = objectType.members.findIndex(
60996
60812
  (member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
60997
60813
  );
@@ -61016,11 +60832,11 @@ function inlineType({
61016
60832
  ];
61017
60833
  }
61018
60834
  let coveredTypenames;
61019
- if (graphql20.isInterfaceType(fragmentRootType)) {
60835
+ if (graphql19.isInterfaceType(fragmentRootType)) {
61020
60836
  coveredTypenames = interfaceCoveredTypenames(fragmentRootType);
61021
- } else if (graphql20.isUnionType(fragmentRootType)) {
60837
+ } else if (graphql19.isUnionType(fragmentRootType)) {
61022
60838
  coveredTypenames = fragmentRootType.getTypes().map((type2) => type2.name);
61023
- } else if (graphql20.isObjectType(fragmentRootType)) {
60839
+ } else if (graphql19.isObjectType(fragmentRootType)) {
61024
60840
  coveredTypenames = [fragmentRootType.name];
61025
60841
  } else {
61026
60842
  throw Error("unreachable code");
@@ -61056,7 +60872,7 @@ function inlineType({
61056
60872
  );
61057
60873
  }
61058
60874
  );
61059
- const parentIsUnionOrInterface = !graphql20.isInterfaceType(type) && !graphql20.isUnionType(type);
60875
+ const parentIsUnionOrInterface = !graphql19.isInterfaceType(type) && !graphql19.isUnionType(type);
61060
60876
  const possibleTypenames = parentIsUnionOrInterface ? [parent.name] : config.schema.getPossibleTypes(type).map((type2) => type2.name);
61061
60877
  const coveredTypenames = new Set(
61062
60878
  Object.values(inlineFragmentSelections).flatMap((sel) => sel.coveredTypenames)
@@ -61123,7 +60939,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
61123
60939
  },
61124
60940
  type: schema.getType("String")
61125
60941
  };
61126
- } else if (graphql20.isNonNullType(rootType) && "getFields" in rootType.ofType) {
60942
+ } else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
61127
60943
  fields = rootType.ofType.getFields();
61128
60944
  } else {
61129
60945
  fields = rootType.getFields();
@@ -61135,7 +60951,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
61135
60951
  message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
61136
60952
  });
61137
60953
  }
61138
- const fieldType = graphql20.getNamedType(field.type);
60954
+ const fieldType = graphql19.getNamedType(field.type);
61139
60955
  if (!fieldType) {
61140
60956
  throw new HoudiniError({
61141
60957
  filepath,
@@ -61351,17 +61167,20 @@ export * from "${module2}"
61351
61167
  }
61352
61168
  }
61353
61169
  await fs_exports.writeFile(config.typeIndexPath, indexContent);
61354
- if (missingScalars.size > 0) {
61355
- console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[...missingScalars].join(
61356
- ", "
61357
- )}
61170
+ const missingScalarNames = [...missingScalars].filter(
61171
+ (scalar) => !config.configFile.features?.runtimeScalars?.[scalar]
61172
+ );
61173
+ if (missingScalarNames.length > 0) {
61174
+ console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[
61175
+ ...missingScalarNames
61176
+ ].join(", ")}
61358
61177
  Generated types will contain an any type in place of these values. To fix this, provide an equivalent
61359
61178
  type in your config file:
61360
61179
 
61361
61180
  {
61362
61181
  scalars: {
61363
61182
  ${cyan2(`/* in your case, something like */`)}
61364
- ${[...missingScalars].map(
61183
+ ${[...missingScalarNames].map(
61365
61184
  (c) => ` ${c}: { ${green2(`// <- The GraphQL Scalar`)}
61366
61185
  type: "${cyan2(`YourType_${c}`)}" ${green2(`// <- The TypeScript type`)}
61367
61186
  }`
@@ -61640,7 +61459,7 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
61640
61459
  }
61641
61460
 
61642
61461
  // src/codegen/generators/typescript/imperativeTypeDef.ts
61643
- var graphql21 = __toESM(require("graphql"), 1);
61462
+ var graphql20 = __toESM(require("graphql"), 1);
61644
61463
  var recast12 = __toESM(require_main2(), 1);
61645
61464
  var AST12 = recast12.types.builders;
61646
61465
  async function imperativeCacheTypef(config, docs) {
@@ -61692,7 +61511,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
61692
61511
  const operationTypes = [config.schema.getMutationType(), config.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
61693
61512
  const visitedTypes = /* @__PURE__ */ new Set();
61694
61513
  const types14 = Object.values(config.schema.getTypeMap()).filter(
61695
- (type) => !graphql21.isAbstractType(type) && !graphql21.isScalarType(type) && !graphql21.isEnumType(type) && !graphql21.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
61514
+ (type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
61696
61515
  );
61697
61516
  const fragmentMap = fragmentListMap(
61698
61517
  config,
@@ -61709,7 +61528,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
61709
61528
  }
61710
61529
  let idFields = AST12.tsNeverKeyword();
61711
61530
  const keys2 = keyFieldsForType(config.configFile, type.name);
61712
- if (graphql21.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
61531
+ if (graphql20.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
61713
61532
  idFields = AST12.tsTypeLiteral(
61714
61533
  keys2.map((key) => {
61715
61534
  const fieldType = type.getFields()[key];
@@ -61736,13 +61555,13 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
61736
61555
  idFields = AST12.tsTypeLiteral([]);
61737
61556
  }
61738
61557
  let fields = AST12.tsTypeLiteral([]);
61739
- if (graphql21.isObjectType(type)) {
61558
+ if (graphql20.isObjectType(type)) {
61740
61559
  fields = AST12.tsTypeLiteral(
61741
61560
  Object.entries(type.getFields()).map(
61742
61561
  ([key, fieldType]) => {
61743
61562
  const unwrapped = unwrapType(config, fieldType.type);
61744
61563
  let typeOptions = AST12.tsUnionType([]);
61745
- if (graphql21.isScalarType(unwrapped.type)) {
61564
+ if (graphql20.isScalarType(unwrapped.type)) {
61746
61565
  typeOptions.types.push(
61747
61566
  scalarPropertyValue(
61748
61567
  config,
@@ -61756,11 +61575,11 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
61756
61575
  }
61757
61576
  )
61758
61577
  );
61759
- } else if (graphql21.isEnumType(unwrapped.type)) {
61578
+ } else if (graphql20.isEnumType(unwrapped.type)) {
61760
61579
  typeOptions.types.push(
61761
61580
  AST12.tsTypeReference(AST12.identifier(unwrapped.type.name))
61762
61581
  );
61763
- } else if (!graphql21.isAbstractType(unwrapped.type)) {
61582
+ } else if (!graphql20.isAbstractType(unwrapped.type)) {
61764
61583
  typeOptions.types.push(record(unwrapped.type.name));
61765
61584
  } else {
61766
61585
  typeOptions.types.push(
@@ -61856,7 +61675,7 @@ function listDefinitions(config, filepath, body, docs) {
61856
61675
  const lists = [];
61857
61676
  const visitedLists = /* @__PURE__ */ new Set();
61858
61677
  for (const doc of docs) {
61859
- graphql21.visit(doc.document, {
61678
+ graphql20.visit(doc.document, {
61860
61679
  Directive(node, key, parent2, path2, ancestors) {
61861
61680
  if (![config.listDirective, config.paginateDirective].includes(node.name.value)) {
61862
61681
  return;
@@ -61878,7 +61697,7 @@ function listDefinitions(config, filepath, body, docs) {
61878
61697
  const targetFieldDefinition = parentType.getFields()[targetField.name.value];
61879
61698
  const { type: listType } = unwrapType(config, targetFieldDefinition.type);
61880
61699
  const possibleTypes = [];
61881
- if (graphql21.isAbstractType(listType)) {
61700
+ if (graphql20.isAbstractType(listType)) {
61882
61701
  possibleTypes.push(
61883
61702
  ...config.schema.getPossibleTypes(listType).map((possible) => possible.name)
61884
61703
  );
@@ -62040,7 +61859,7 @@ async function typescriptGenerator(config, docs) {
62040
61859
  }
62041
61860
 
62042
61861
  // src/codegen/generators/persistedQueries/index.ts
62043
- var graphql22 = __toESM(require("graphql"), 1);
61862
+ var graphql21 = __toESM(require("graphql"), 1);
62044
61863
  async function persistOutputGenerator(config, docs) {
62045
61864
  if (!config.persistedQueriesPath.endsWith(".json")) {
62046
61865
  throw new Error('Can write Persisted Queries only in a ".json" file.');
@@ -62050,8 +61869,8 @@ async function persistOutputGenerator(config, docs) {
62050
61869
  if (!generateArtifact) {
62051
61870
  return acc;
62052
61871
  }
62053
- let rawString = graphql22.print(
62054
- graphql22.visit(document, {
61872
+ let rawString = graphql21.print(
61873
+ graphql21.visit(document, {
62055
61874
  Directive(node) {
62056
61875
  if (config.isInternalDirective(node.name.value)) {
62057
61876
  return null;
@@ -62060,7 +61879,7 @@ async function persistOutputGenerator(config, docs) {
62060
61879
  })
62061
61880
  );
62062
61881
  const operations = document.definitions.filter(
62063
- ({ kind }) => kind === graphql22.Kind.OPERATION_DEFINITION
61882
+ ({ kind }) => kind === graphql21.Kind.OPERATION_DEFINITION
62064
61883
  );
62065
61884
  if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
62066
61885
  if (artifact) {
@@ -62075,33 +61894,45 @@ async function persistOutputGenerator(config, docs) {
62075
61894
  }
62076
61895
 
62077
61896
  // src/codegen/generators/definitions/index.ts
62078
- var graphql24 = __toESM(require("graphql"), 1);
61897
+ var graphql23 = __toESM(require("graphql"), 1);
62079
61898
 
62080
61899
  // src/codegen/generators/definitions/enums.ts
62081
- var graphql23 = __toESM(require("graphql"), 1);
61900
+ var graphql22 = __toESM(require("graphql"), 1);
62082
61901
  var recast13 = __toESM(require_main2(), 1);
62083
61902
  var AST13 = recast13.types.builders;
62084
61903
  async function definitionsGenerator(config) {
62085
- const enums = graphql23.parse(graphql23.printSchema(config.schema)).definitions.filter(
61904
+ const enums = graphql22.parse(graphql22.printSchema(config.schema)).definitions.filter(
62086
61905
  (definition) => definition.kind === "EnumTypeDefinition"
62087
61906
  ).filter((def) => !config.isInternalEnum(def));
62088
61907
  const { code: runtimeDefinitions } = await printJS(
62089
61908
  AST13.program(
62090
61909
  enums.map((defn) => {
62091
61910
  const name = defn.name.value;
62092
- return moduleExport(
61911
+ const declaration = moduleExport(
62093
61912
  config,
62094
61913
  name,
62095
61914
  AST13.objectExpression(
62096
61915
  defn.values?.map((value) => {
62097
61916
  const str = value.name.value;
62098
- return AST13.objectProperty(
61917
+ const prop = AST13.objectProperty(
62099
61918
  AST13.stringLiteral(str),
62100
61919
  AST13.stringLiteral(str)
62101
61920
  );
61921
+ const deprecationReason = value.directives?.find((d) => d.name.value === "deprecated")?.arguments?.find((a) => a.name.value === "reason")?.value?.value;
61922
+ if (value.description || deprecationReason)
61923
+ prop.comments = [
61924
+ jsdocComment(value.description?.value ?? "", deprecationReason)
61925
+ ];
61926
+ return prop;
62102
61927
  }) || []
62103
61928
  )
62104
61929
  );
61930
+ if (defn.description) {
61931
+ declaration.comments = [
61932
+ AST13.commentBlock(`* ${defn.description.value} `, true, false)
61933
+ ];
61934
+ }
61935
+ return declaration;
62105
61936
  })
62106
61937
  )
62107
61938
  );
@@ -62110,11 +61941,19 @@ type ValuesOf<T> = T[keyof T]
62110
61941
  ` + enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map((definition) => {
62111
61942
  const name = definition.name.value;
62112
61943
  const values = definition.values;
62113
- return `
61944
+ let jsdoc = "";
61945
+ if (definition.description) {
61946
+ jsdoc = `
61947
+ /** ${definition.description.value} */`;
61948
+ }
61949
+ return `${jsdoc}
62114
61950
  export declare const ${name}: {
62115
- ${values?.map((value) => ` readonly ${value.name.value}: "${value.name.value}";`).join("\n")}
61951
+ ${values?.map(
61952
+ (value) => (value.description ? ` /** ${value.description.value} */
61953
+ ` : "") + ` readonly ${value.name.value}: "${value.name.value}";`
61954
+ ).join("\n")}
62116
61955
  }
62117
-
61956
+ ${jsdoc}
62118
61957
  export type ${name}$options = ValuesOf<typeof ${name}>
62119
61958
  `;
62120
61959
  }).join("");
@@ -62134,7 +61973,7 @@ async function schemaGenerator(config) {
62134
61973
  await Promise.all([
62135
61974
  fs_exports.writeFile(
62136
61975
  config.definitionsSchemaPath,
62137
- config.localSchema ? graphql24.printSchema(config.schema) : config.newSchema
61976
+ config.localSchema ? graphql23.printSchema(config.schema) : config.newSchema
62138
61977
  ),
62139
61978
  fs_exports.writeFile(config.definitionsDocumentsPath, config.newDocuments),
62140
61979
  definitionsGenerator(config)
@@ -62179,7 +62018,7 @@ async function writeIndexFile2(config, docs) {
62179
62018
  }
62180
62019
 
62181
62020
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/helpers.js
62182
- var import_graphql2 = require("graphql");
62021
+ var import_graphql3 = require("graphql");
62183
62022
  function compareStrings(a, b) {
62184
62023
  if (String(a) < String(b)) {
62185
62024
  return -1;
@@ -62215,7 +62054,7 @@ function isSome(input) {
62215
62054
  }
62216
62055
 
62217
62056
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/inspect.js
62218
- var import_graphql3 = require("graphql");
62057
+ var import_graphql4 = require("graphql");
62219
62058
  var MAX_RECURSIVE_DEPTH = 3;
62220
62059
  function inspect(value) {
62221
62060
  return formatValue(value, []);
@@ -62233,7 +62072,7 @@ function formatValue(value, seenValues) {
62233
62072
  }
62234
62073
  }
62235
62074
  function formatError(value) {
62236
- if (value instanceof import_graphql3.GraphQLError) {
62075
+ if (value instanceof import_graphql4.GraphQLError) {
62237
62076
  return value.toString();
62238
62077
  }
62239
62078
  return `${value.name}: ${value.message};
@@ -62316,43 +62155,43 @@ function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ["direct
62316
62155
  }
62317
62156
 
62318
62157
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js
62319
- var import_graphql7 = require("graphql");
62158
+ var import_graphql8 = require("graphql");
62320
62159
 
62321
62160
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromType.js
62322
- var import_graphql4 = require("graphql");
62161
+ var import_graphql5 = require("graphql");
62323
62162
  function astFromType(type) {
62324
- if ((0, import_graphql4.isNonNullType)(type)) {
62163
+ if ((0, import_graphql5.isNonNullType)(type)) {
62325
62164
  const innerType = astFromType(type.ofType);
62326
- if (innerType.kind === import_graphql4.Kind.NON_NULL_TYPE) {
62165
+ if (innerType.kind === import_graphql5.Kind.NON_NULL_TYPE) {
62327
62166
  throw new Error(`Invalid type node ${inspect(type)}. Inner type of non-null type cannot be a non-null type.`);
62328
62167
  }
62329
62168
  return {
62330
- kind: import_graphql4.Kind.NON_NULL_TYPE,
62169
+ kind: import_graphql5.Kind.NON_NULL_TYPE,
62331
62170
  type: innerType
62332
62171
  };
62333
- } else if ((0, import_graphql4.isListType)(type)) {
62172
+ } else if ((0, import_graphql5.isListType)(type)) {
62334
62173
  return {
62335
- kind: import_graphql4.Kind.LIST_TYPE,
62174
+ kind: import_graphql5.Kind.LIST_TYPE,
62336
62175
  type: astFromType(type.ofType)
62337
62176
  };
62338
62177
  }
62339
62178
  return {
62340
- kind: import_graphql4.Kind.NAMED_TYPE,
62179
+ kind: import_graphql5.Kind.NAMED_TYPE,
62341
62180
  name: {
62342
- kind: import_graphql4.Kind.NAME,
62181
+ kind: import_graphql5.Kind.NAME,
62343
62182
  value: type.name
62344
62183
  }
62345
62184
  };
62346
62185
  }
62347
62186
 
62348
62187
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
62349
- var import_graphql6 = require("graphql");
62188
+ var import_graphql7 = require("graphql");
62350
62189
 
62351
62190
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js
62352
- var import_graphql5 = require("graphql");
62191
+ var import_graphql6 = require("graphql");
62353
62192
  function astFromValueUntyped(value) {
62354
62193
  if (value === null) {
62355
- return { kind: import_graphql5.Kind.NULL };
62194
+ return { kind: import_graphql6.Kind.NULL };
62356
62195
  }
62357
62196
  if (value === void 0) {
62358
62197
  return null;
@@ -62365,7 +62204,7 @@ function astFromValueUntyped(value) {
62365
62204
  valuesNodes.push(itemNode);
62366
62205
  }
62367
62206
  }
62368
- return { kind: import_graphql5.Kind.LIST, values: valuesNodes };
62207
+ return { kind: import_graphql6.Kind.LIST, values: valuesNodes };
62369
62208
  }
62370
62209
  if (typeof value === "object") {
62371
62210
  const fieldNodes = [];
@@ -62374,26 +62213,26 @@ function astFromValueUntyped(value) {
62374
62213
  const ast = astFromValueUntyped(fieldValue);
62375
62214
  if (ast) {
62376
62215
  fieldNodes.push({
62377
- kind: import_graphql5.Kind.OBJECT_FIELD,
62378
- name: { kind: import_graphql5.Kind.NAME, value: fieldName },
62216
+ kind: import_graphql6.Kind.OBJECT_FIELD,
62217
+ name: { kind: import_graphql6.Kind.NAME, value: fieldName },
62379
62218
  value: ast
62380
62219
  });
62381
62220
  }
62382
62221
  }
62383
- return { kind: import_graphql5.Kind.OBJECT, fields: fieldNodes };
62222
+ return { kind: import_graphql6.Kind.OBJECT, fields: fieldNodes };
62384
62223
  }
62385
62224
  if (typeof value === "boolean") {
62386
- return { kind: import_graphql5.Kind.BOOLEAN, value };
62225
+ return { kind: import_graphql6.Kind.BOOLEAN, value };
62387
62226
  }
62388
62227
  if (typeof value === "bigint") {
62389
- return { kind: import_graphql5.Kind.INT, value: String(value) };
62228
+ return { kind: import_graphql6.Kind.INT, value: String(value) };
62390
62229
  }
62391
62230
  if (typeof value === "number" && isFinite(value)) {
62392
62231
  const stringNum = String(value);
62393
- return integerStringRegExp.test(stringNum) ? { kind: import_graphql5.Kind.INT, value: stringNum } : { kind: import_graphql5.Kind.FLOAT, value: stringNum };
62232
+ return integerStringRegExp.test(stringNum) ? { kind: import_graphql6.Kind.INT, value: stringNum } : { kind: import_graphql6.Kind.FLOAT, value: stringNum };
62394
62233
  }
62395
62234
  if (typeof value === "string") {
62396
- return { kind: import_graphql5.Kind.STRING, value };
62235
+ return { kind: import_graphql6.Kind.STRING, value };
62397
62236
  }
62398
62237
  throw new TypeError(`Cannot convert value to AST: ${value}.`);
62399
62238
  }
@@ -62401,20 +62240,20 @@ var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;
62401
62240
 
62402
62241
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
62403
62242
  function astFromValue(value, type) {
62404
- if ((0, import_graphql6.isNonNullType)(type)) {
62243
+ if ((0, import_graphql7.isNonNullType)(type)) {
62405
62244
  const astValue = astFromValue(value, type.ofType);
62406
- if (astValue?.kind === import_graphql6.Kind.NULL) {
62245
+ if (astValue?.kind === import_graphql7.Kind.NULL) {
62407
62246
  return null;
62408
62247
  }
62409
62248
  return astValue;
62410
62249
  }
62411
62250
  if (value === null) {
62412
- return { kind: import_graphql6.Kind.NULL };
62251
+ return { kind: import_graphql7.Kind.NULL };
62413
62252
  }
62414
62253
  if (value === void 0) {
62415
62254
  return null;
62416
62255
  }
62417
- if ((0, import_graphql6.isListType)(type)) {
62256
+ if ((0, import_graphql7.isListType)(type)) {
62418
62257
  const itemType = type.ofType;
62419
62258
  if (isIterableObject(value)) {
62420
62259
  const valuesNodes = [];
@@ -62424,11 +62263,11 @@ function astFromValue(value, type) {
62424
62263
  valuesNodes.push(itemNode);
62425
62264
  }
62426
62265
  }
62427
- return { kind: import_graphql6.Kind.LIST, values: valuesNodes };
62266
+ return { kind: import_graphql7.Kind.LIST, values: valuesNodes };
62428
62267
  }
62429
62268
  return astFromValue(value, itemType);
62430
62269
  }
62431
- if ((0, import_graphql6.isInputObjectType)(type)) {
62270
+ if ((0, import_graphql7.isInputObjectType)(type)) {
62432
62271
  if (!isObjectLike(value)) {
62433
62272
  return null;
62434
62273
  }
@@ -62437,24 +62276,24 @@ function astFromValue(value, type) {
62437
62276
  const fieldValue = astFromValue(value[field.name], field.type);
62438
62277
  if (fieldValue) {
62439
62278
  fieldNodes.push({
62440
- kind: import_graphql6.Kind.OBJECT_FIELD,
62441
- name: { kind: import_graphql6.Kind.NAME, value: field.name },
62279
+ kind: import_graphql7.Kind.OBJECT_FIELD,
62280
+ name: { kind: import_graphql7.Kind.NAME, value: field.name },
62442
62281
  value: fieldValue
62443
62282
  });
62444
62283
  }
62445
62284
  }
62446
- return { kind: import_graphql6.Kind.OBJECT, fields: fieldNodes };
62285
+ return { kind: import_graphql7.Kind.OBJECT, fields: fieldNodes };
62447
62286
  }
62448
- if ((0, import_graphql6.isLeafType)(type)) {
62287
+ if ((0, import_graphql7.isLeafType)(type)) {
62449
62288
  const serialized = type.serialize(value);
62450
62289
  if (serialized == null) {
62451
62290
  return null;
62452
62291
  }
62453
- if ((0, import_graphql6.isEnumType)(type)) {
62454
- return { kind: import_graphql6.Kind.ENUM, value: serialized };
62292
+ if ((0, import_graphql7.isEnumType)(type)) {
62293
+ return { kind: import_graphql7.Kind.ENUM, value: serialized };
62455
62294
  }
62456
62295
  if (type.name === "ID" && typeof serialized === "string" && integerStringRegExp2.test(serialized)) {
62457
- return { kind: import_graphql6.Kind.INT, value: serialized };
62296
+ return { kind: import_graphql7.Kind.INT, value: serialized };
62458
62297
  }
62459
62298
  return astFromValueUntyped(serialized);
62460
62299
  }
@@ -62510,36 +62349,36 @@ function getDocumentNodeFromSchema(schema, options = {}) {
62510
62349
  const definitions = schemaNode != null ? [schemaNode] : [];
62511
62350
  const directives = schema.getDirectives();
62512
62351
  for (const directive of directives) {
62513
- if ((0, import_graphql7.isSpecifiedDirective)(directive)) {
62352
+ if ((0, import_graphql8.isSpecifiedDirective)(directive)) {
62514
62353
  continue;
62515
62354
  }
62516
62355
  definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
62517
62356
  }
62518
62357
  for (const typeName in typesMap) {
62519
62358
  const type = typesMap[typeName];
62520
- const isPredefinedScalar = (0, import_graphql7.isSpecifiedScalarType)(type);
62521
- const isIntrospection = (0, import_graphql7.isIntrospectionType)(type);
62359
+ const isPredefinedScalar = (0, import_graphql8.isSpecifiedScalarType)(type);
62360
+ const isIntrospection = (0, import_graphql8.isIntrospectionType)(type);
62522
62361
  if (isPredefinedScalar || isIntrospection) {
62523
62362
  continue;
62524
62363
  }
62525
- if ((0, import_graphql7.isObjectType)(type)) {
62364
+ if ((0, import_graphql8.isObjectType)(type)) {
62526
62365
  definitions.push(astFromObjectType(type, schema, pathToDirectivesInExtensions));
62527
- } else if ((0, import_graphql7.isInterfaceType)(type)) {
62366
+ } else if ((0, import_graphql8.isInterfaceType)(type)) {
62528
62367
  definitions.push(astFromInterfaceType(type, schema, pathToDirectivesInExtensions));
62529
- } else if ((0, import_graphql7.isUnionType)(type)) {
62368
+ } else if ((0, import_graphql8.isUnionType)(type)) {
62530
62369
  definitions.push(astFromUnionType(type, schema, pathToDirectivesInExtensions));
62531
- } else if ((0, import_graphql7.isInputObjectType)(type)) {
62370
+ } else if ((0, import_graphql8.isInputObjectType)(type)) {
62532
62371
  definitions.push(astFromInputObjectType(type, schema, pathToDirectivesInExtensions));
62533
- } else if ((0, import_graphql7.isEnumType)(type)) {
62372
+ } else if ((0, import_graphql8.isEnumType)(type)) {
62534
62373
  definitions.push(astFromEnumType(type, schema, pathToDirectivesInExtensions));
62535
- } else if ((0, import_graphql7.isScalarType)(type)) {
62374
+ } else if ((0, import_graphql8.isScalarType)(type)) {
62536
62375
  definitions.push(astFromScalarType(type, schema, pathToDirectivesInExtensions));
62537
62376
  } else {
62538
62377
  throw new Error(`Unknown type ${type}.`);
62539
62378
  }
62540
62379
  }
62541
62380
  return {
62542
- kind: import_graphql7.Kind.DOCUMENT,
62381
+ kind: import_graphql8.Kind.DOCUMENT,
62543
62382
  definitions
62544
62383
  };
62545
62384
  }
@@ -62574,7 +62413,7 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
62574
62413
  operationTypeDefinitionNode.type = rootTypeAST;
62575
62414
  } else {
62576
62415
  operationTypeMap.set(operationTypeNode, {
62577
- kind: import_graphql7.Kind.OPERATION_TYPE_DEFINITION,
62416
+ kind: import_graphql8.Kind.OPERATION_TYPE_DEFINITION,
62578
62417
  operation: operationTypeNode,
62579
62418
  type: rootTypeAST
62580
62419
  });
@@ -62587,12 +62426,12 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
62587
62426
  return null;
62588
62427
  }
62589
62428
  const schemaNode = {
62590
- kind: operationTypes != null ? import_graphql7.Kind.SCHEMA_DEFINITION : import_graphql7.Kind.SCHEMA_EXTENSION,
62429
+ kind: operationTypes != null ? import_graphql8.Kind.SCHEMA_DEFINITION : import_graphql8.Kind.SCHEMA_EXTENSION,
62591
62430
  operationTypes,
62592
62431
  directives
62593
62432
  };
62594
62433
  schemaNode.description = schema.astNode?.description ?? schema.description != null ? {
62595
- kind: import_graphql7.Kind.STRING,
62434
+ kind: import_graphql8.Kind.STRING,
62596
62435
  value: schema.description,
62597
62436
  block: true
62598
62437
  } : void 0;
@@ -62600,19 +62439,19 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
62600
62439
  }
62601
62440
  function astFromDirective(directive, schema, pathToDirectivesInExtensions) {
62602
62441
  return {
62603
- kind: import_graphql7.Kind.DIRECTIVE_DEFINITION,
62442
+ kind: import_graphql8.Kind.DIRECTIVE_DEFINITION,
62604
62443
  description: directive.astNode?.description ?? (directive.description ? {
62605
- kind: import_graphql7.Kind.STRING,
62444
+ kind: import_graphql8.Kind.STRING,
62606
62445
  value: directive.description
62607
62446
  } : void 0),
62608
62447
  name: {
62609
- kind: import_graphql7.Kind.NAME,
62448
+ kind: import_graphql8.Kind.NAME,
62610
62449
  value: directive.name
62611
62450
  },
62612
62451
  arguments: directive.args?.map((arg) => astFromArg(arg, schema, pathToDirectivesInExtensions)),
62613
62452
  repeatable: directive.isRepeatable,
62614
62453
  locations: directive.locations?.map((location) => ({
62615
- kind: import_graphql7.Kind.NAME,
62454
+ kind: import_graphql8.Kind.NAME,
62616
62455
  value: location
62617
62456
  })) || []
62618
62457
  };
@@ -62662,14 +62501,14 @@ function getDeprecatableDirectiveNodes(entity, schema, pathToDirectivesInExtensi
62662
62501
  }
62663
62502
  function astFromArg(arg, schema, pathToDirectivesInExtensions) {
62664
62503
  return {
62665
- kind: import_graphql7.Kind.INPUT_VALUE_DEFINITION,
62504
+ kind: import_graphql8.Kind.INPUT_VALUE_DEFINITION,
62666
62505
  description: arg.astNode?.description ?? (arg.description ? {
62667
- kind: import_graphql7.Kind.STRING,
62506
+ kind: import_graphql8.Kind.STRING,
62668
62507
  value: arg.description,
62669
62508
  block: true
62670
62509
  } : void 0),
62671
62510
  name: {
62672
- kind: import_graphql7.Kind.NAME,
62511
+ kind: import_graphql8.Kind.NAME,
62673
62512
  value: arg.name
62674
62513
  },
62675
62514
  type: astFromType(arg.type),
@@ -62679,14 +62518,14 @@ function astFromArg(arg, schema, pathToDirectivesInExtensions) {
62679
62518
  }
62680
62519
  function astFromObjectType(type, schema, pathToDirectivesInExtensions) {
62681
62520
  return {
62682
- kind: import_graphql7.Kind.OBJECT_TYPE_DEFINITION,
62521
+ kind: import_graphql8.Kind.OBJECT_TYPE_DEFINITION,
62683
62522
  description: type.astNode?.description ?? (type.description ? {
62684
- kind: import_graphql7.Kind.STRING,
62523
+ kind: import_graphql8.Kind.STRING,
62685
62524
  value: type.description,
62686
62525
  block: true
62687
62526
  } : void 0),
62688
62527
  name: {
62689
- kind: import_graphql7.Kind.NAME,
62528
+ kind: import_graphql8.Kind.NAME,
62690
62529
  value: type.name
62691
62530
  },
62692
62531
  fields: Object.values(type.getFields()).map((field) => astFromField(field, schema, pathToDirectivesInExtensions)),
@@ -62696,14 +62535,14 @@ function astFromObjectType(type, schema, pathToDirectivesInExtensions) {
62696
62535
  }
62697
62536
  function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {
62698
62537
  const node = {
62699
- kind: import_graphql7.Kind.INTERFACE_TYPE_DEFINITION,
62538
+ kind: import_graphql8.Kind.INTERFACE_TYPE_DEFINITION,
62700
62539
  description: type.astNode?.description ?? (type.description ? {
62701
- kind: import_graphql7.Kind.STRING,
62540
+ kind: import_graphql8.Kind.STRING,
62702
62541
  value: type.description,
62703
62542
  block: true
62704
62543
  } : void 0),
62705
62544
  name: {
62706
- kind: import_graphql7.Kind.NAME,
62545
+ kind: import_graphql8.Kind.NAME,
62707
62546
  value: type.name
62708
62547
  },
62709
62548
  fields: Object.values(type.getFields()).map((field) => astFromField(field, schema, pathToDirectivesInExtensions)),
@@ -62716,14 +62555,14 @@ function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {
62716
62555
  }
62717
62556
  function astFromUnionType(type, schema, pathToDirectivesInExtensions) {
62718
62557
  return {
62719
- kind: import_graphql7.Kind.UNION_TYPE_DEFINITION,
62558
+ kind: import_graphql8.Kind.UNION_TYPE_DEFINITION,
62720
62559
  description: type.astNode?.description ?? (type.description ? {
62721
- kind: import_graphql7.Kind.STRING,
62560
+ kind: import_graphql8.Kind.STRING,
62722
62561
  value: type.description,
62723
62562
  block: true
62724
62563
  } : void 0),
62725
62564
  name: {
62726
- kind: import_graphql7.Kind.NAME,
62565
+ kind: import_graphql8.Kind.NAME,
62727
62566
  value: type.name
62728
62567
  },
62729
62568
  directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions),
@@ -62732,14 +62571,14 @@ function astFromUnionType(type, schema, pathToDirectivesInExtensions) {
62732
62571
  }
62733
62572
  function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {
62734
62573
  return {
62735
- kind: import_graphql7.Kind.INPUT_OBJECT_TYPE_DEFINITION,
62574
+ kind: import_graphql8.Kind.INPUT_OBJECT_TYPE_DEFINITION,
62736
62575
  description: type.astNode?.description ?? (type.description ? {
62737
- kind: import_graphql7.Kind.STRING,
62576
+ kind: import_graphql8.Kind.STRING,
62738
62577
  value: type.description,
62739
62578
  block: true
62740
62579
  } : void 0),
62741
62580
  name: {
62742
- kind: import_graphql7.Kind.NAME,
62581
+ kind: import_graphql8.Kind.NAME,
62743
62582
  value: type.name
62744
62583
  },
62745
62584
  fields: Object.values(type.getFields()).map((field) => astFromInputField(field, schema, pathToDirectivesInExtensions)),
@@ -62748,14 +62587,14 @@ function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {
62748
62587
  }
62749
62588
  function astFromEnumType(type, schema, pathToDirectivesInExtensions) {
62750
62589
  return {
62751
- kind: import_graphql7.Kind.ENUM_TYPE_DEFINITION,
62590
+ kind: import_graphql8.Kind.ENUM_TYPE_DEFINITION,
62752
62591
  description: type.astNode?.description ?? (type.description ? {
62753
- kind: import_graphql7.Kind.STRING,
62592
+ kind: import_graphql8.Kind.STRING,
62754
62593
  value: type.description,
62755
62594
  block: true
62756
62595
  } : void 0),
62757
62596
  name: {
62758
- kind: import_graphql7.Kind.NAME,
62597
+ kind: import_graphql8.Kind.NAME,
62759
62598
  value: type.name
62760
62599
  },
62761
62600
  values: Object.values(type.getValues()).map((value) => astFromEnumValue(value, schema, pathToDirectivesInExtensions)),
@@ -62773,14 +62612,14 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
62773
62612
  directives.push(makeDirectiveNode("specifiedBy", specifiedByArgs));
62774
62613
  }
62775
62614
  return {
62776
- kind: import_graphql7.Kind.SCALAR_TYPE_DEFINITION,
62615
+ kind: import_graphql8.Kind.SCALAR_TYPE_DEFINITION,
62777
62616
  description: type.astNode?.description ?? (type.description ? {
62778
- kind: import_graphql7.Kind.STRING,
62617
+ kind: import_graphql8.Kind.STRING,
62779
62618
  value: type.description,
62780
62619
  block: true
62781
62620
  } : void 0),
62782
62621
  name: {
62783
- kind: import_graphql7.Kind.NAME,
62622
+ kind: import_graphql8.Kind.NAME,
62784
62623
  value: type.name
62785
62624
  },
62786
62625
  directives
@@ -62788,14 +62627,14 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
62788
62627
  }
62789
62628
  function astFromField(field, schema, pathToDirectivesInExtensions) {
62790
62629
  return {
62791
- kind: import_graphql7.Kind.FIELD_DEFINITION,
62630
+ kind: import_graphql8.Kind.FIELD_DEFINITION,
62792
62631
  description: field.astNode?.description ?? (field.description ? {
62793
- kind: import_graphql7.Kind.STRING,
62632
+ kind: import_graphql8.Kind.STRING,
62794
62633
  value: field.description,
62795
62634
  block: true
62796
62635
  } : void 0),
62797
62636
  name: {
62798
- kind: import_graphql7.Kind.NAME,
62637
+ kind: import_graphql8.Kind.NAME,
62799
62638
  value: field.name
62800
62639
  },
62801
62640
  arguments: field.args.map((arg) => astFromArg(arg, schema, pathToDirectivesInExtensions)),
@@ -62805,14 +62644,14 @@ function astFromField(field, schema, pathToDirectivesInExtensions) {
62805
62644
  }
62806
62645
  function astFromInputField(field, schema, pathToDirectivesInExtensions) {
62807
62646
  return {
62808
- kind: import_graphql7.Kind.INPUT_VALUE_DEFINITION,
62647
+ kind: import_graphql8.Kind.INPUT_VALUE_DEFINITION,
62809
62648
  description: field.astNode?.description ?? (field.description ? {
62810
- kind: import_graphql7.Kind.STRING,
62649
+ kind: import_graphql8.Kind.STRING,
62811
62650
  value: field.description,
62812
62651
  block: true
62813
62652
  } : void 0),
62814
62653
  name: {
62815
- kind: import_graphql7.Kind.NAME,
62654
+ kind: import_graphql8.Kind.NAME,
62816
62655
  value: field.name
62817
62656
  },
62818
62657
  type: astFromType(field.type),
@@ -62822,21 +62661,21 @@ function astFromInputField(field, schema, pathToDirectivesInExtensions) {
62822
62661
  }
62823
62662
  function astFromEnumValue(value, schema, pathToDirectivesInExtensions) {
62824
62663
  return {
62825
- kind: import_graphql7.Kind.ENUM_VALUE_DEFINITION,
62664
+ kind: import_graphql8.Kind.ENUM_VALUE_DEFINITION,
62826
62665
  description: value.astNode?.description ?? (value.description ? {
62827
- kind: import_graphql7.Kind.STRING,
62666
+ kind: import_graphql8.Kind.STRING,
62828
62667
  value: value.description,
62829
62668
  block: true
62830
62669
  } : void 0),
62831
62670
  name: {
62832
- kind: import_graphql7.Kind.NAME,
62671
+ kind: import_graphql8.Kind.NAME,
62833
62672
  value: value.name
62834
62673
  },
62835
62674
  directives: getDeprecatableDirectiveNodes(value, schema, pathToDirectivesInExtensions)
62836
62675
  };
62837
62676
  }
62838
62677
  function makeDeprecatedDirective(deprecationReason) {
62839
- return makeDirectiveNode("deprecated", { reason: deprecationReason }, import_graphql7.GraphQLDeprecatedDirective);
62678
+ return makeDirectiveNode("deprecated", { reason: deprecationReason }, import_graphql8.GraphQLDeprecatedDirective);
62840
62679
  }
62841
62680
  function makeDirectiveNode(name, args, directive) {
62842
62681
  const directiveArguments = [];
@@ -62848,9 +62687,9 @@ function makeDirectiveNode(name, args, directive) {
62848
62687
  const value = astFromValue(argValue, arg.type);
62849
62688
  if (value) {
62850
62689
  directiveArguments.push({
62851
- kind: import_graphql7.Kind.ARGUMENT,
62690
+ kind: import_graphql8.Kind.ARGUMENT,
62852
62691
  name: {
62853
- kind: import_graphql7.Kind.NAME,
62692
+ kind: import_graphql8.Kind.NAME,
62854
62693
  value: argName
62855
62694
  },
62856
62695
  value
@@ -62864,9 +62703,9 @@ function makeDirectiveNode(name, args, directive) {
62864
62703
  const value = astFromValueUntyped(argValue);
62865
62704
  if (value) {
62866
62705
  directiveArguments.push({
62867
- kind: import_graphql7.Kind.ARGUMENT,
62706
+ kind: import_graphql8.Kind.ARGUMENT,
62868
62707
  name: {
62869
- kind: import_graphql7.Kind.NAME,
62708
+ kind: import_graphql8.Kind.NAME,
62870
62709
  value: argName
62871
62710
  },
62872
62711
  value
@@ -62875,9 +62714,9 @@ function makeDirectiveNode(name, args, directive) {
62875
62714
  }
62876
62715
  }
62877
62716
  return {
62878
- kind: import_graphql7.Kind.DIRECTIVE,
62717
+ kind: import_graphql8.Kind.DIRECTIVE,
62879
62718
  name: {
62880
- kind: import_graphql7.Kind.NAME,
62719
+ kind: import_graphql8.Kind.NAME,
62881
62720
  value: name
62882
62721
  },
62883
62722
  arguments: directiveArguments
@@ -62900,7 +62739,7 @@ function makeDirectiveNodes(schema, directiveValues) {
62900
62739
  }
62901
62740
 
62902
62741
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/comments.js
62903
- var import_graphql8 = require("graphql");
62742
+ var import_graphql9 = require("graphql");
62904
62743
  var MAX_LINE_LENGTH = 80;
62905
62744
  var commentsRegistry = {};
62906
62745
  function resetComments() {
@@ -63145,7 +62984,7 @@ var printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((pre
63145
62984
  }
63146
62985
  }), {});
63147
62986
  function printWithComments(ast) {
63148
- return (0, import_graphql8.visit)(ast, printDocASTReducerWithComments);
62987
+ return (0, import_graphql9.visit)(ast, printDocASTReducerWithComments);
63149
62988
  }
63150
62989
  function isFieldDefinitionNode(node) {
63151
62990
  return node.kind === "FieldDefinition";
@@ -63164,7 +63003,7 @@ function getLeadingCommentBlock(node) {
63164
63003
  }
63165
63004
  const comments = [];
63166
63005
  let token = loc.startToken.prev;
63167
- while (token != null && token.kind === import_graphql8.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
63006
+ while (token != null && token.kind === import_graphql9.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
63168
63007
  const value = String(token.value);
63169
63008
  comments.push(value);
63170
63009
  token = token.prev;
@@ -63216,9 +63055,9 @@ function isBlank(str) {
63216
63055
  }
63217
63056
 
63218
63057
  // ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/isDocumentNode.js
63219
- var import_graphql9 = require("graphql");
63058
+ var import_graphql10 = require("graphql");
63220
63059
  function isDocumentNode(object) {
63221
- return object && typeof object === "object" && "kind" in object && object.kind === import_graphql9.Kind.DOCUMENT;
63060
+ return object && typeof object === "object" && "kind" in object && object.kind === import_graphql10.Kind.DOCUMENT;
63222
63061
  }
63223
63062
 
63224
63063
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js
@@ -63242,7 +63081,7 @@ function deduplicateArguments(args, config) {
63242
63081
  }
63243
63082
 
63244
63083
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js
63245
- var import_graphql10 = require("graphql");
63084
+ var import_graphql11 = require("graphql");
63246
63085
  function directiveAlreadyExists(directivesArr, otherDirective) {
63247
63086
  return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
63248
63087
  }
@@ -63302,11 +63141,11 @@ function mergeDirectives(d1 = [], d2 = [], config, directives) {
63302
63141
  return result;
63303
63142
  }
63304
63143
  function validateInputs(node, existingNode) {
63305
- const printedNode = (0, import_graphql10.print)({
63144
+ const printedNode = (0, import_graphql11.print)({
63306
63145
  ...node,
63307
63146
  description: void 0
63308
63147
  });
63309
- const printedExistingNode = (0, import_graphql10.print)({
63148
+ const printedExistingNode = (0, import_graphql11.print)({
63310
63149
  ...existingNode,
63311
63150
  description: void 0
63312
63151
  });
@@ -63373,7 +63212,7 @@ function mergeEnumValues(first, second, config, directives) {
63373
63212
  }
63374
63213
 
63375
63214
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js
63376
- var import_graphql11 = require("graphql");
63215
+ var import_graphql12 = require("graphql");
63377
63216
  function mergeEnum(e1, e2, config, directives) {
63378
63217
  if (e2) {
63379
63218
  return {
@@ -63387,33 +63226,33 @@ function mergeEnum(e1, e2, config, directives) {
63387
63226
  }
63388
63227
  return config?.convertExtensions ? {
63389
63228
  ...e1,
63390
- kind: import_graphql11.Kind.ENUM_TYPE_DEFINITION
63229
+ kind: import_graphql12.Kind.ENUM_TYPE_DEFINITION
63391
63230
  } : e1;
63392
63231
  }
63393
63232
 
63394
63233
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
63395
- var import_graphql12 = require("graphql");
63234
+ var import_graphql13 = require("graphql");
63396
63235
  function isStringTypes(types14) {
63397
63236
  return typeof types14 === "string";
63398
63237
  }
63399
63238
  function isSourceTypes(types14) {
63400
- return types14 instanceof import_graphql12.Source;
63239
+ return types14 instanceof import_graphql13.Source;
63401
63240
  }
63402
63241
  function extractType(type) {
63403
63242
  let visitedType = type;
63404
- while (visitedType.kind === import_graphql12.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
63243
+ while (visitedType.kind === import_graphql13.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
63405
63244
  visitedType = visitedType.type;
63406
63245
  }
63407
63246
  return visitedType;
63408
63247
  }
63409
63248
  function isWrappingTypeNode(type) {
63410
- return type.kind !== import_graphql12.Kind.NAMED_TYPE;
63249
+ return type.kind !== import_graphql13.Kind.NAMED_TYPE;
63411
63250
  }
63412
63251
  function isListTypeNode(type) {
63413
- return type.kind === import_graphql12.Kind.LIST_TYPE;
63252
+ return type.kind === import_graphql13.Kind.LIST_TYPE;
63414
63253
  }
63415
63254
  function isNonNullTypeNode(type) {
63416
- return type.kind === import_graphql12.Kind.NON_NULL_TYPE;
63255
+ return type.kind === import_graphql13.Kind.NON_NULL_TYPE;
63417
63256
  }
63418
63257
  function printTypeNode(type) {
63419
63258
  if (isListTypeNode(type)) {
@@ -63516,7 +63355,7 @@ function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
63516
63355
  }
63517
63356
 
63518
63357
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js
63519
- var import_graphql13 = require("graphql");
63358
+ var import_graphql14 = require("graphql");
63520
63359
  function mergeInputType(node, existingNode, config, directives) {
63521
63360
  if (existingNode) {
63522
63361
  try {
@@ -63534,12 +63373,12 @@ function mergeInputType(node, existingNode, config, directives) {
63534
63373
  }
63535
63374
  return config?.convertExtensions ? {
63536
63375
  ...node,
63537
- kind: import_graphql13.Kind.INPUT_OBJECT_TYPE_DEFINITION
63376
+ kind: import_graphql14.Kind.INPUT_OBJECT_TYPE_DEFINITION
63538
63377
  } : node;
63539
63378
  }
63540
63379
 
63541
63380
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js
63542
- var import_graphql14 = require("graphql");
63381
+ var import_graphql15 = require("graphql");
63543
63382
 
63544
63383
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js
63545
63384
  function alreadyExists(arr, other) {
@@ -63572,15 +63411,15 @@ function mergeInterface(node, existingNode, config, directives) {
63572
63411
  }
63573
63412
  return config?.convertExtensions ? {
63574
63413
  ...node,
63575
- kind: import_graphql14.Kind.INTERFACE_TYPE_DEFINITION
63414
+ kind: import_graphql15.Kind.INTERFACE_TYPE_DEFINITION
63576
63415
  } : node;
63577
63416
  }
63578
63417
 
63579
63418
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js
63580
- var import_graphql19 = require("graphql");
63419
+ var import_graphql20 = require("graphql");
63581
63420
 
63582
63421
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js
63583
- var import_graphql15 = require("graphql");
63422
+ var import_graphql16 = require("graphql");
63584
63423
  function mergeType(node, existingNode, config, directives) {
63585
63424
  if (existingNode) {
63586
63425
  try {
@@ -63599,12 +63438,12 @@ function mergeType(node, existingNode, config, directives) {
63599
63438
  }
63600
63439
  return config?.convertExtensions ? {
63601
63440
  ...node,
63602
- kind: import_graphql15.Kind.OBJECT_TYPE_DEFINITION
63441
+ kind: import_graphql16.Kind.OBJECT_TYPE_DEFINITION
63603
63442
  } : node;
63604
63443
  }
63605
63444
 
63606
63445
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js
63607
- var import_graphql16 = require("graphql");
63446
+ var import_graphql17 = require("graphql");
63608
63447
  function mergeScalar(node, existingNode, config, directives) {
63609
63448
  if (existingNode) {
63610
63449
  return {
@@ -63617,31 +63456,31 @@ function mergeScalar(node, existingNode, config, directives) {
63617
63456
  }
63618
63457
  return config?.convertExtensions ? {
63619
63458
  ...node,
63620
- kind: import_graphql16.Kind.SCALAR_TYPE_DEFINITION
63459
+ kind: import_graphql17.Kind.SCALAR_TYPE_DEFINITION
63621
63460
  } : node;
63622
63461
  }
63623
63462
 
63624
63463
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js
63625
- var import_graphql17 = require("graphql");
63464
+ var import_graphql18 = require("graphql");
63626
63465
  function mergeUnion(first, second, config, directives) {
63627
63466
  if (second) {
63628
63467
  return {
63629
63468
  name: first.name,
63630
63469
  description: first["description"] || second["description"],
63631
63470
  directives: mergeDirectives(first.directives, second.directives, config, directives),
63632
- kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql17.Kind.UNION_TYPE_DEFINITION : import_graphql17.Kind.UNION_TYPE_EXTENSION,
63471
+ kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql18.Kind.UNION_TYPE_DEFINITION : import_graphql18.Kind.UNION_TYPE_EXTENSION,
63633
63472
  loc: first.loc,
63634
63473
  types: mergeNamedTypeArray(first.types, second.types, config)
63635
63474
  };
63636
63475
  }
63637
63476
  return config?.convertExtensions ? {
63638
63477
  ...first,
63639
- kind: import_graphql17.Kind.UNION_TYPE_DEFINITION
63478
+ kind: import_graphql18.Kind.UNION_TYPE_DEFINITION
63640
63479
  } : first;
63641
63480
  }
63642
63481
 
63643
63482
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js
63644
- var import_graphql18 = require("graphql");
63483
+ var import_graphql19 = require("graphql");
63645
63484
  var DEFAULT_OPERATION_TYPE_NAME_MAP = {
63646
63485
  query: "Query",
63647
63486
  mutation: "Mutation",
@@ -63660,7 +63499,7 @@ function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) {
63660
63499
  function mergeSchemaDefs(node, existingNode, config, directives) {
63661
63500
  if (existingNode) {
63662
63501
  return {
63663
- kind: node.kind === import_graphql18.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql18.Kind.SCHEMA_DEFINITION ? import_graphql18.Kind.SCHEMA_DEFINITION : import_graphql18.Kind.SCHEMA_EXTENSION,
63502
+ kind: node.kind === import_graphql19.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql19.Kind.SCHEMA_DEFINITION ? import_graphql19.Kind.SCHEMA_DEFINITION : import_graphql19.Kind.SCHEMA_EXTENSION,
63664
63503
  description: node["description"] || existingNode["description"],
63665
63504
  directives: mergeDirectives(node.directives, existingNode.directives, config, directives),
63666
63505
  operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes)
@@ -63668,7 +63507,7 @@ function mergeSchemaDefs(node, existingNode, config, directives) {
63668
63507
  }
63669
63508
  return config?.convertExtensions ? {
63670
63509
  ...node,
63671
- kind: import_graphql18.Kind.SCHEMA_DEFINITION
63510
+ kind: import_graphql19.Kind.SCHEMA_DEFINITION
63672
63511
  } : node;
63673
63512
  }
63674
63513
 
@@ -63692,36 +63531,36 @@ function mergeGraphQLNodes(nodes, config, directives = {}) {
63692
63531
  delete mergedResultMap[name];
63693
63532
  } else {
63694
63533
  switch (nodeDefinition.kind) {
63695
- case import_graphql19.Kind.OBJECT_TYPE_DEFINITION:
63696
- case import_graphql19.Kind.OBJECT_TYPE_EXTENSION:
63534
+ case import_graphql20.Kind.OBJECT_TYPE_DEFINITION:
63535
+ case import_graphql20.Kind.OBJECT_TYPE_EXTENSION:
63697
63536
  mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config, directives);
63698
63537
  break;
63699
- case import_graphql19.Kind.ENUM_TYPE_DEFINITION:
63700
- case import_graphql19.Kind.ENUM_TYPE_EXTENSION:
63538
+ case import_graphql20.Kind.ENUM_TYPE_DEFINITION:
63539
+ case import_graphql20.Kind.ENUM_TYPE_EXTENSION:
63701
63540
  mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config, directives);
63702
63541
  break;
63703
- case import_graphql19.Kind.UNION_TYPE_DEFINITION:
63704
- case import_graphql19.Kind.UNION_TYPE_EXTENSION:
63542
+ case import_graphql20.Kind.UNION_TYPE_DEFINITION:
63543
+ case import_graphql20.Kind.UNION_TYPE_EXTENSION:
63705
63544
  mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config, directives);
63706
63545
  break;
63707
- case import_graphql19.Kind.SCALAR_TYPE_DEFINITION:
63708
- case import_graphql19.Kind.SCALAR_TYPE_EXTENSION:
63546
+ case import_graphql20.Kind.SCALAR_TYPE_DEFINITION:
63547
+ case import_graphql20.Kind.SCALAR_TYPE_EXTENSION:
63709
63548
  mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config, directives);
63710
63549
  break;
63711
- case import_graphql19.Kind.INPUT_OBJECT_TYPE_DEFINITION:
63712
- case import_graphql19.Kind.INPUT_OBJECT_TYPE_EXTENSION:
63550
+ case import_graphql20.Kind.INPUT_OBJECT_TYPE_DEFINITION:
63551
+ case import_graphql20.Kind.INPUT_OBJECT_TYPE_EXTENSION:
63713
63552
  mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config, directives);
63714
63553
  break;
63715
- case import_graphql19.Kind.INTERFACE_TYPE_DEFINITION:
63716
- case import_graphql19.Kind.INTERFACE_TYPE_EXTENSION:
63554
+ case import_graphql20.Kind.INTERFACE_TYPE_DEFINITION:
63555
+ case import_graphql20.Kind.INTERFACE_TYPE_EXTENSION:
63717
63556
  mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config, directives);
63718
63557
  break;
63719
- case import_graphql19.Kind.DIRECTIVE_DEFINITION:
63558
+ case import_graphql20.Kind.DIRECTIVE_DEFINITION:
63720
63559
  mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]);
63721
63560
  break;
63722
63561
  }
63723
63562
  }
63724
- } else if (nodeDefinition.kind === import_graphql19.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql19.Kind.SCHEMA_EXTENSION) {
63563
+ } else if (nodeDefinition.kind === import_graphql20.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql20.Kind.SCHEMA_EXTENSION) {
63725
63564
  mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config);
63726
63565
  }
63727
63566
  }
@@ -63729,11 +63568,11 @@ function mergeGraphQLNodes(nodes, config, directives = {}) {
63729
63568
  }
63730
63569
 
63731
63570
  // ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js
63732
- var import_graphql20 = require("graphql");
63571
+ var import_graphql21 = require("graphql");
63733
63572
  function mergeTypeDefs(typeSource, config) {
63734
63573
  resetComments();
63735
63574
  const doc = {
63736
- kind: import_graphql20.Kind.DOCUMENT,
63575
+ kind: import_graphql21.Kind.DOCUMENT,
63737
63576
  definitions: mergeGraphQLTypes(typeSource, {
63738
63577
  useSchemaDefinition: true,
63739
63578
  forceSchemaDefinition: false,
@@ -63760,14 +63599,14 @@ function visitTypeSources(typeSource, options, allDirectives = [], allNodes = []
63760
63599
  for (const type of typeSource) {
63761
63600
  visitTypeSources(type, options, allDirectives, allNodes, visitedTypeSources);
63762
63601
  }
63763
- } else if ((0, import_graphql20.isSchema)(typeSource)) {
63602
+ } else if ((0, import_graphql21.isSchema)(typeSource)) {
63764
63603
  const documentNode = getDocumentNodeFromSchema(typeSource, options);
63765
63604
  visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
63766
63605
  } else if (isStringTypes(typeSource) || isSourceTypes(typeSource)) {
63767
- const documentNode = (0, import_graphql20.parse)(typeSource, options);
63606
+ const documentNode = (0, import_graphql21.parse)(typeSource, options);
63768
63607
  visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
63769
- } else if (typeof typeSource === "object" && (0, import_graphql20.isDefinitionNode)(typeSource)) {
63770
- if (typeSource.kind === import_graphql20.Kind.DIRECTIVE_DEFINITION) {
63608
+ } else if (typeof typeSource === "object" && (0, import_graphql21.isDefinitionNode)(typeSource)) {
63609
+ if (typeSource.kind === import_graphql21.Kind.DIRECTIVE_DEFINITION) {
63771
63610
  allDirectives.push(typeSource);
63772
63611
  } else {
63773
63612
  allNodes.push(typeSource);
@@ -63787,7 +63626,7 @@ function mergeGraphQLTypes(typeSource, config) {
63787
63626
  const mergedNodes = mergeGraphQLNodes(allNodes, config, mergedDirectives);
63788
63627
  if (config?.useSchemaDefinition) {
63789
63628
  const schemaDef = mergedNodes[schemaDefSymbol] || {
63790
- kind: import_graphql20.Kind.SCHEMA_DEFINITION,
63629
+ kind: import_graphql21.Kind.SCHEMA_DEFINITION,
63791
63630
  operationTypes: []
63792
63631
  };
63793
63632
  const operationTypes = schemaDef.operationTypes;
@@ -63798,9 +63637,9 @@ function mergeGraphQLTypes(typeSource, config) {
63798
63637
  const existingPossibleRootType = mergedNodes[possibleRootTypeName];
63799
63638
  if (existingPossibleRootType != null && existingPossibleRootType.name != null) {
63800
63639
  operationTypes.push({
63801
- kind: import_graphql20.Kind.OPERATION_TYPE_DEFINITION,
63640
+ kind: import_graphql21.Kind.OPERATION_TYPE_DEFINITION,
63802
63641
  type: {
63803
- kind: import_graphql20.Kind.NAMED_TYPE,
63642
+ kind: import_graphql21.Kind.NAMED_TYPE,
63804
63643
  name: existingPossibleRootType.name
63805
63644
  },
63806
63645
  operation: opTypeDefNodeType
@@ -63814,15 +63653,15 @@ function mergeGraphQLTypes(typeSource, config) {
63814
63653
  }
63815
63654
  if (config?.forceSchemaDefinition && !mergedNodes[schemaDefSymbol]?.operationTypes?.length) {
63816
63655
  mergedNodes[schemaDefSymbol] = {
63817
- kind: import_graphql20.Kind.SCHEMA_DEFINITION,
63656
+ kind: import_graphql21.Kind.SCHEMA_DEFINITION,
63818
63657
  operationTypes: [
63819
63658
  {
63820
- kind: import_graphql20.Kind.OPERATION_TYPE_DEFINITION,
63659
+ kind: import_graphql21.Kind.OPERATION_TYPE_DEFINITION,
63821
63660
  operation: "query",
63822
63661
  type: {
63823
- kind: import_graphql20.Kind.NAMED_TYPE,
63662
+ kind: import_graphql21.Kind.NAMED_TYPE,
63824
63663
  name: {
63825
- kind: import_graphql20.Kind.NAME,
63664
+ kind: import_graphql21.Kind.NAME,
63826
63665
  value: "Query"
63827
63666
  }
63828
63667
  }
@@ -63839,7 +63678,7 @@ function mergeGraphQLTypes(typeSource, config) {
63839
63678
  }
63840
63679
 
63841
63680
  // src/codegen/transforms/schema.ts
63842
- var graphql25 = __toESM(require("graphql"), 1);
63681
+ var graphql24 = __toESM(require("graphql"), 1);
63843
63682
  async function graphqlExtensions(config, documents) {
63844
63683
  let internalSchema = `
63845
63684
  enum CachePolicy {
@@ -63943,7 +63782,7 @@ ${config.configFile.features?.componentFields ? `
63943
63782
  """
63944
63783
  @${config.componentFieldDirective} marks an inline fragment as the selection for a component field
63945
63784
  """
63946
- directive @${config.componentFieldDirective}(field: String!, prop: String, export: String, raw: String) on FRAGMENT_DEFINITION | INLINE_FRAGMENT
63785
+ directive @${config.componentFieldDirective}(field: String!, prop: String, export: String, raw: String) on FRAGMENT_DEFINITION | INLINE_FRAGMENT | FIELD_DEFINITION
63947
63786
 
63948
63787
  ` : ""}
63949
63788
 
@@ -63954,7 +63793,7 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
63954
63793
  }
63955
63794
  internalSchema += plugin2.schema({ config });
63956
63795
  }
63957
- const extensions = Object.entries(config.componentFields).map(([parent2, fields]) => {
63796
+ let extensions = Object.entries(config.componentFields).map(([parent2, fields]) => {
63958
63797
  return `
63959
63798
  extend type ${parent2} {
63960
63799
  ${Object.entries(fields).map(([fieldName, field]) => {
@@ -63962,29 +63801,30 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
63962
63801
  const args = fragmentArguments(config, "", field.parent);
63963
63802
  if (args.length > 0) {
63964
63803
  argString = "(" + args.map((arg) => {
63965
- const typeName = graphql25.print(arg.type);
63804
+ const typeName = graphql24.print(arg.type);
63966
63805
  return `${arg.name}:${typeName}${arg.required ? "!" : ""}`;
63967
63806
  }).join("\n") + ")";
63968
63807
  }
63969
- return `${fieldName}${argString}: ${config.componentScalar}!`;
63808
+ return `${fieldName}${argString}: ${config.componentScalar}! @componentField(field: "${fieldName}")`;
63970
63809
  }).join("\n")}
63971
63810
  }
63972
63811
  `;
63973
63812
  }).join("\n");
63974
- config.newSchema = graphql25.print(mergeTypeDefs([internalSchema, config.newSchema]));
63813
+ extensions += `${Object.keys(config.configFile.features?.runtimeScalars ?? {}).map((scalar) => `scalar ${scalar}`).join("\n")}`;
63814
+ config.newSchema = graphql24.print(mergeTypeDefs([internalSchema, config.newSchema]));
63975
63815
  config.schemaString += extensions;
63976
- config.schema = graphql25.buildSchema(
63977
- graphql25.print(
63978
- mergeTypeDefs([graphql25.printSchema(config.schema), internalSchema, extensions])
63816
+ config.schema = graphql24.buildSchema(
63817
+ graphql24.print(
63818
+ mergeTypeDefs([graphql24.printSchema(config.schema), internalSchema, extensions])
63979
63819
  )
63980
63820
  );
63981
63821
  }
63982
63822
 
63983
63823
  // src/codegen/transforms/typename.ts
63984
- var graphql26 = __toESM(require("graphql"), 1);
63824
+ var graphql25 = __toESM(require("graphql"), 1);
63985
63825
  async function addTypename(config, documents) {
63986
63826
  for (const doc of documents) {
63987
- doc.document = graphql26.visit(doc.document, {
63827
+ doc.document = graphql25.visit(doc.document, {
63988
63828
  Field(node, key, parent2, path2, ancestors) {
63989
63829
  if (!node.selectionSet) {
63990
63830
  return;
@@ -63996,7 +63836,7 @@ async function addTypename(config, documents) {
63996
63836
  );
63997
63837
  const field = type.getFields()[node.name.value];
63998
63838
  const fieldType = unwrapType(config, field.type).type;
63999
- if (graphql26.isInterfaceType(fieldType) || graphql26.isUnionType(fieldType)) {
63839
+ if (graphql25.isInterfaceType(fieldType) || graphql25.isUnionType(fieldType)) {
64000
63840
  return {
64001
63841
  ...node,
64002
63842
  selectionSet: {
@@ -64004,9 +63844,9 @@ async function addTypename(config, documents) {
64004
63844
  selections: [
64005
63845
  ...node.selectionSet.selections,
64006
63846
  {
64007
- kind: graphql26.Kind.FIELD,
63847
+ kind: graphql25.Kind.FIELD,
64008
63848
  name: {
64009
- kind: graphql26.Kind.NAME,
63849
+ kind: graphql25.Kind.NAME,
64010
63850
  value: "__typename"
64011
63851
  }
64012
63852
  }
@@ -64023,9 +63863,9 @@ async function addTypename(config, documents) {
64023
63863
  selections: [
64024
63864
  ...node.selectionSet.selections,
64025
63865
  {
64026
- kind: graphql26.Kind.FIELD,
63866
+ kind: graphql25.Kind.FIELD,
64027
63867
  name: {
64028
- kind: graphql26.Kind.NAME,
63868
+ kind: graphql25.Kind.NAME,
64029
63869
  value: "__typename"
64030
63870
  }
64031
63871
  }
@@ -64038,10 +63878,10 @@ async function addTypename(config, documents) {
64038
63878
  }
64039
63879
 
64040
63880
  // src/codegen/transforms/addID.ts
64041
- var graphql27 = __toESM(require("graphql"), 1);
63881
+ var graphql26 = __toESM(require("graphql"), 1);
64042
63882
  async function addID(config, documents) {
64043
63883
  for (const doc of documents) {
64044
- doc.document = graphql27.visit(doc.document, {
63884
+ doc.document = graphql26.visit(doc.document, {
64045
63885
  Field(node, key, parent2, path2, ancestors) {
64046
63886
  if (!node.selectionSet) {
64047
63887
  return;
@@ -64079,7 +63919,7 @@ function addKeysToSelection(config, node, fieldType) {
64079
63919
  if (!node.selectionSet || node.selectionSet.selections.length == 0) {
64080
63920
  return;
64081
63921
  }
64082
- if (!graphql27.isObjectType(fieldType) && !graphql27.isInterfaceType(fieldType)) {
63922
+ if (!graphql26.isObjectType(fieldType) && !graphql26.isInterfaceType(fieldType)) {
64083
63923
  return;
64084
63924
  }
64085
63925
  const keyFields = config.keyFieldsForType(fieldType.name);
@@ -64094,9 +63934,9 @@ function addKeysToSelection(config, node, fieldType) {
64094
63934
  continue;
64095
63935
  }
64096
63936
  selections.push({
64097
- kind: graphql27.Kind.FIELD,
63937
+ kind: graphql26.Kind.FIELD,
64098
63938
  name: {
64099
- kind: graphql27.Kind.NAME,
63939
+ kind: graphql26.Kind.NAME,
64100
63940
  value: keyField
64101
63941
  }
64102
63942
  });
@@ -64111,13 +63951,13 @@ function addKeysToSelection(config, node, fieldType) {
64111
63951
  }
64112
63952
 
64113
63953
  // src/codegen/transforms/componentFields.ts
64114
- var graphql28 = __toESM(require("graphql"), 1);
63954
+ var graphql27 = __toESM(require("graphql"), 1);
64115
63955
  async function componentFields(config, documents) {
64116
63956
  for (const document of documents) {
64117
- const typeInfo = new graphql28.TypeInfo(config.schema);
64118
- document.document = graphql28.visit(
63957
+ const typeInfo = new graphql27.TypeInfo(config.schema);
63958
+ document.document = graphql27.visit(
64119
63959
  document.document,
64120
- graphql28.visitWithTypeInfo(typeInfo, {
63960
+ graphql27.visitWithTypeInfo(typeInfo, {
64121
63961
  Field(node) {
64122
63962
  const parentType = typeInfo.getParentType();
64123
63963
  if (!parentType) {
@@ -64165,6 +64005,48 @@ async function componentFields(config, documents) {
64165
64005
  }
64166
64006
  }
64167
64007
 
64008
+ // src/codegen/transforms/runtimeScalars.ts
64009
+ var graphql28 = __toESM(require("graphql"), 1);
64010
+ async function addTypename2(config, documents) {
64011
+ for (const doc of documents) {
64012
+ doc.document = graphql28.visit(doc.document, {
64013
+ VariableDefinition(node) {
64014
+ const { type, wrappers } = unwrapType(config, node.type);
64015
+ const runtimeScalar = config.configFile.features?.runtimeScalars?.[type.name];
64016
+ if (runtimeScalar) {
64017
+ return {
64018
+ ...node,
64019
+ type: wrapType({
64020
+ type: config.schema.getType(runtimeScalar.type),
64021
+ wrappers
64022
+ }),
64023
+ directives: [
64024
+ ...node.directives ?? [],
64025
+ {
64026
+ kind: "Directive",
64027
+ name: {
64028
+ kind: "Name",
64029
+ value: config.runtimeScalarDirective
64030
+ },
64031
+ arguments: [
64032
+ {
64033
+ kind: "Argument",
64034
+ name: { kind: "Name", value: "type" },
64035
+ value: {
64036
+ kind: "StringValue",
64037
+ value: type.name
64038
+ }
64039
+ }
64040
+ ]
64041
+ }
64042
+ ]
64043
+ };
64044
+ }
64045
+ }
64046
+ });
64047
+ }
64048
+ }
64049
+
64168
64050
  // src/codegen/validators/typeCheck.ts
64169
64051
  var graphql29 = __toESM(require("graphql"), 1);
64170
64052
  async function typeCheck(config, docs) {
@@ -65166,10 +65048,22 @@ async function componentFields2(config, docs) {
65166
65048
  }
65167
65049
  const fieldValue = fieldArg.value?.kind === "StringValue" ? fieldArg.value.value : void 0;
65168
65050
  const propValue = propArg.value?.kind === "StringValue" ? propArg.value.value : void 0;
65051
+ const existingField = fieldValue && config.componentFields[parent2]?.[fieldValue];
65169
65052
  const parentType = config.schema.getType(parent2);
65170
- if (parentType && fieldValue && (graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue] || config.componentFields[parent2]?.[fieldValue])) {
65053
+ let conflict = false;
65054
+ if (existingField && existingField.filepath !== filepath) {
65055
+ conflict = true;
65056
+ } else if (parentType && fieldValue) {
65057
+ const fieldDef = graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue];
65058
+ if (fieldDef && !fieldDef.astNode?.directives?.find(
65059
+ (dir) => dir.name.value === config.componentFieldDirective
65060
+ )) {
65061
+ conflict = true;
65062
+ }
65063
+ }
65064
+ if (conflict) {
65171
65065
  errors.push({
65172
- message: `Duplicate component field definition for ${parent2}.${fieldValue}`,
65066
+ message: `Duplicate component field definition for ${parent2}.${fieldValue}.` + (existingField ? "The conflicting component field was defined in " + existingField.filepath : ""),
65173
65067
  filepath
65174
65068
  });
65175
65069
  }
@@ -65239,6 +65133,7 @@ async function runPipeline2(config, docs) {
65239
65133
  [
65240
65134
  componentFields2,
65241
65135
  graphqlExtensions,
65136
+ addTypename2,
65242
65137
  ...wrapHook(beforeValidate),
65243
65138
  typeCheck,
65244
65139
  uniqueDocumentNames,