@baeta/plugin-graphql 1.0.9 → 1.0.11
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.
- package/CHANGELOG.md +9 -0
- package/dist/index.js +10 -45
- package/dist/index.js.map +1 -1
- package/package.json +10 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @baeta/plugin-graphql
|
|
2
2
|
|
|
3
|
+
## 1.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c7b9c05`](https://github.com/andreisergiu98/baeta/commit/c7b9c0523eb9827c99b2bcfc7dbe02f5ef389f21) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - Allow import from packages for scalars and context
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`7cbd2ef`](https://github.com/andreisergiu98/baeta/commit/7cbd2ef5b7697f703e4cc6f8d9612c7d01a10dd1), [`c7b9c05`](https://github.com/andreisergiu98/baeta/commit/c7b9c0523eb9827c99b2bcfc7dbe02f5ef389f21)]:
|
|
10
|
+
- @baeta/generator-sdk@1.0.2
|
|
11
|
+
|
|
3
12
|
## 1.0.9
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,6 @@ var __export = (target, all) => {
|
|
|
8
8
|
import { createPluginV1, isMatch } from "@baeta/generator-sdk";
|
|
9
9
|
|
|
10
10
|
// lib/codegen.ts
|
|
11
|
-
import { join as join2 } from "@baeta/util-path";
|
|
12
11
|
import { codegen as gqlCodegen } from "@graphql-codegen/core";
|
|
13
12
|
import { normalizeConfig, normalizeInstanceOrArray } from "@graphql-codegen/plugin-helpers";
|
|
14
13
|
import * as typescriptPlugin from "@graphql-codegen/typescript";
|
|
@@ -37,7 +36,7 @@ import {
|
|
|
37
36
|
import { validateSchema } from "graphql";
|
|
38
37
|
|
|
39
38
|
// utils/hash.ts
|
|
40
|
-
import { createHash } from "
|
|
39
|
+
import { createHash } from "crypto";
|
|
41
40
|
import { getCachedDocumentNodeFromSchema } from "@graphql-codegen/plugin-helpers";
|
|
42
41
|
import { print } from "graphql";
|
|
43
42
|
function hashContent(content) {
|
|
@@ -72,45 +71,16 @@ ${messages}`);
|
|
|
72
71
|
};
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
// utils/scalars.ts
|
|
76
|
-
import { dirname, isAbsolute, joinSafe, relative } from "@baeta/util-path";
|
|
77
|
-
import { parseMapper } from "@graphql-codegen/visitor-plugin-common";
|
|
78
|
-
function buildScalarMap(map, cwd, typesPath) {
|
|
79
|
-
if (!map) {
|
|
80
|
-
return {};
|
|
81
|
-
}
|
|
82
|
-
const fixedMap = {};
|
|
83
|
-
for (const key in map) {
|
|
84
|
-
const mapped = parseMapper(map[key]);
|
|
85
|
-
if (!mapped.isExternal) {
|
|
86
|
-
fixedMap[key] = map[key];
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
if (isAbsolute(mapped.source)) {
|
|
90
|
-
fixedMap[key] = map[key];
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
const scalarPath = joinSafe(cwd, mapped.source);
|
|
94
|
-
const relativePath = relative(dirname(typesPath), scalarPath);
|
|
95
|
-
if (mapped.default) {
|
|
96
|
-
fixedMap[key] = `${relativePath}#default`;
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
fixedMap[key] = `${relativePath}#${mapped.import}`;
|
|
100
|
-
}
|
|
101
|
-
return fixedMap;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
74
|
// lib/context/index.ts
|
|
105
75
|
var context_exports = {};
|
|
106
76
|
__export(context_exports, {
|
|
107
77
|
default: () => context_default,
|
|
108
78
|
plugin: () => plugin
|
|
109
79
|
});
|
|
110
|
-
import { buildMapperImport, parseMapper
|
|
111
|
-
var plugin = async (
|
|
80
|
+
import { buildMapperImport, parseMapper } from "@graphql-codegen/visitor-plugin-common";
|
|
81
|
+
var plugin = async (_schema, _documents, config) => {
|
|
112
82
|
const prepend = [];
|
|
113
|
-
const mapper =
|
|
83
|
+
const mapper = parseMapper(config.contextType || "any");
|
|
114
84
|
if (mapper.isExternal && mapper.source) {
|
|
115
85
|
const identifier = mapper.default ? "ContextType" : `${mapper.import} as ContextType`;
|
|
116
86
|
const result = buildMapperImport(
|
|
@@ -138,7 +108,7 @@ var plugin = async (schema, documents, config) => {
|
|
|
138
108
|
var context_default = { plugin };
|
|
139
109
|
|
|
140
110
|
// lib/modules/index.ts
|
|
141
|
-
import { basename, join, relative
|
|
111
|
+
import { basename, join, relative, resolve } from "@baeta/util-path";
|
|
142
112
|
import { BaseVisitor, getConfigValue } from "@graphql-codegen/visitor-plugin-common";
|
|
143
113
|
import {
|
|
144
114
|
concatAST,
|
|
@@ -148,10 +118,10 @@ import {
|
|
|
148
118
|
// lib/modules/builder.ts
|
|
149
119
|
import { pascalCase } from "change-case-all";
|
|
150
120
|
import {
|
|
151
|
-
Kind as Kind3,
|
|
152
121
|
isInterfaceType,
|
|
153
122
|
isScalarType,
|
|
154
123
|
isUnionType,
|
|
124
|
+
Kind as Kind3,
|
|
155
125
|
visit
|
|
156
126
|
} from "graphql";
|
|
157
127
|
|
|
@@ -198,7 +168,7 @@ function buildTypeName(node) {
|
|
|
198
168
|
}
|
|
199
169
|
|
|
200
170
|
// lib/modules/utils.ts
|
|
201
|
-
import { platform } from "
|
|
171
|
+
import { platform } from "os";
|
|
202
172
|
import { getBaseType } from "@graphql-codegen/plugin-helpers";
|
|
203
173
|
import { DEFAULT_SCALARS, wrapTypeWithModifiers } from "@graphql-codegen/visitor-plugin-common";
|
|
204
174
|
import {
|
|
@@ -433,7 +403,6 @@ function buildModule(name, doc, {
|
|
|
433
403
|
importNamespace,
|
|
434
404
|
importPath,
|
|
435
405
|
encapsulate,
|
|
436
|
-
requireRootResolvers,
|
|
437
406
|
shouldDeclare,
|
|
438
407
|
rootTypes,
|
|
439
408
|
schema,
|
|
@@ -912,7 +881,7 @@ var preset = {
|
|
|
912
881
|
}
|
|
913
882
|
},
|
|
914
883
|
"modules-exported-picks": {
|
|
915
|
-
plugin: (
|
|
884
|
+
plugin: () => {
|
|
916
885
|
const typePicks = [];
|
|
917
886
|
const unionPicks = [];
|
|
918
887
|
const unionResults = [];
|
|
@@ -1038,7 +1007,7 @@ ${result}
|
|
|
1038
1007
|
const outputs = modules.map((moduleName) => {
|
|
1039
1008
|
const filename = resolve(cwd, baseOutputDir, moduleName, options.presetConfig.filename);
|
|
1040
1009
|
const dirpath = stripFilename(filename);
|
|
1041
|
-
const relativePath =
|
|
1010
|
+
const relativePath = relative(dirpath, baseTypesDir);
|
|
1042
1011
|
const importPath = options.presetConfig.importBaseTypesFrom || normalize(join(relativePath, baseTypesFilename));
|
|
1043
1012
|
const sources2 = sourcesByModuleMap[moduleName];
|
|
1044
1013
|
const documents = sources2.map((source) => source.document);
|
|
@@ -1131,11 +1100,7 @@ async function generate(options) {
|
|
|
1131
1100
|
inputMaybeValue: "T | undefined",
|
|
1132
1101
|
contextType: rootConfig.contextType,
|
|
1133
1102
|
useTypeImports: true,
|
|
1134
|
-
scalars:
|
|
1135
|
-
rootConfig.scalars,
|
|
1136
|
-
options.cwd,
|
|
1137
|
-
join2(options.modulesDir, options.baseTypesPath)
|
|
1138
|
-
)
|
|
1103
|
+
scalars: rootConfig.scalars
|
|
1139
1104
|
}
|
|
1140
1105
|
});
|
|
1141
1106
|
const promises = outputs.map(async (output) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts","../lib/codegen.ts","../utils/cache.ts","../utils/load.ts","../utils/hash.ts","../utils/scalars.ts","../lib/context/index.ts","../lib/modules/index.ts","../lib/modules/builder.ts","../lib/modules/hashes.ts","../lib/modules/utils.ts"],"sourcesContent":["import { type WatcherFile, createPluginV1, isMatch } from '@baeta/generator-sdk';\nimport { generate } from './lib/codegen.ts';\n\nexport function graphqlPlugin() {\n\treturn createPluginV1({\n\t\tname: 'graphql',\n\t\tactionName: 'GraphQL modules',\n\t\twatch: (options, watcher, reload) => {\n\t\t\tconst handleChange = (file: WatcherFile) => {\n\t\t\t\tif (isMatch(file.relativePath, options.schemas)) {\n\t\t\t\t\treload(file);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\twatcher.on('update', handleChange);\n\t\t\twatcher.on('delete', handleChange);\n\t\t},\n\t\tgenerate: async (ctx, next) => {\n\t\t\tconst items = await generate(ctx.generatorOptions);\n\n\t\t\tfor (const item of items) {\n\t\t\t\tctx.fileManager.createAndAdd(item.filename, item.content, 'graphql');\n\t\t\t}\n\n\t\t\treturn next();\n\t\t},\n\t});\n}\n","import type { NormalizedGeneratorOptions } from '@baeta/generator-sdk';\nimport { join } from '@baeta/util-path';\nimport { codegen as gqlCodegen } from '@graphql-codegen/core';\nimport { normalizeConfig, normalizeInstanceOrArray } from '@graphql-codegen/plugin-helpers';\nimport * as typescriptPlugin from '@graphql-codegen/typescript';\nimport type { UnnormalizedTypeDefPointer } from '@graphql-tools/load';\nimport { createCache } from '../utils/cache.ts';\nimport { loadSchema } from '../utils/load.ts';\nimport { buildScalarMap } from '../utils/scalars.ts';\nimport * as contextPlugin from './context/index.ts';\nimport * as modules from './modules/index.ts';\n\nexport async function generate(options: NormalizedGeneratorOptions) {\n\tconst rootConfig = {\n\t\tschemas: normalizeInstanceOrArray(options.schemas),\n\t\tmodulesDir: options.modulesDir,\n\t\tbaseTypesPath: options.baseTypesPath,\n\t\tcontextType: options.contextType,\n\t\tmoduleDefinitionName: options.moduleDefinitionName,\n\t\tscalars: options.scalars,\n\t\tplugins: normalizeConfig(['typescript', 'context']),\n\t\tpluginMap: {\n\t\t\ttypescript: typescriptPlugin,\n\t\t\tcontext: contextPlugin,\n\t\t},\n\t};\n\n\tconst cache = createCache();\n\n\tconst schemaPointerMap: UnnormalizedTypeDefPointer = {};\n\tfor (const ptr of rootConfig.schemas) {\n\t\tif (typeof ptr === 'string') {\n\t\t\tschemaPointerMap[ptr] = {};\n\t\t} else if (typeof ptr === 'object') {\n\t\t\tObject.assign(schemaPointerMap, ptr);\n\t\t}\n\t}\n\n\tconst hash = JSON.stringify(schemaPointerMap);\n\tconst result = await cache('schema', hash, async () => {\n\t\treturn loadSchema(schemaPointerMap, options.cwd, options.loaders);\n\t});\n\n\tconst outputs = await modules.preset.buildGeneratesSection({\n\t\tbaseOutputDir: options.modulesDir,\n\t\tpresetConfig: {\n\t\t\tbaseTypesPath: rootConfig.baseTypesPath,\n\t\t\tfilename: rootConfig.moduleDefinitionName,\n\t\t\tencapsulateModuleTypes: 'none',\n\t\t\textensionsPath: options.extensions,\n\t\t\timportExtension: options.importExtension,\n\t\t},\n\t\tschema: result.outputSchema,\n\t\tschemaAst: result.outputSchemaAst,\n\t\tdocuments: [],\n\t\tpluginMap: rootConfig.pluginMap,\n\t\tplugins: rootConfig.plugins,\n\t\tconfig: {\n\t\t\tinputMaybeValue: 'T | undefined',\n\t\t\tcontextType: rootConfig.contextType,\n\t\t\tuseTypeImports: true,\n\t\t\tscalars: buildScalarMap(\n\t\t\t\trootConfig.scalars,\n\t\t\t\toptions.cwd,\n\t\t\t\tjoin(options.modulesDir, options.baseTypesPath),\n\t\t\t),\n\t\t},\n\t});\n\n\tconst promises = outputs.map(async (output) => {\n\t\tconst result = await gqlCodegen({\n\t\t\t...output,\n\t\t\tcache,\n\t\t});\n\n\t\treturn {\n\t\t\tfilename: output.filename,\n\t\t\tcontent: result,\n\t\t};\n\t});\n\n\treturn Promise.all(promises);\n}\n","export function createCache(): <T>(\n\tnamespace: string,\n\tkey: string,\n\tfactory: () => Promise<T>,\n) => Promise<T> {\n\tconst cache = new Map<string, Promise<unknown>>();\n\n\treturn function ensure<T>(namespace: string, key: string, factory: () => Promise<T>): Promise<T> {\n\t\tconst cacheKey = `${namespace}:${key}`;\n\n\t\tconst cachedValue = cache.get(cacheKey);\n\n\t\tif (cachedValue) {\n\t\t\treturn cachedValue as Promise<T>;\n\t\t}\n\n\t\tconst value = factory();\n\t\tcache.set(cacheKey, value);\n\n\t\treturn value;\n\t};\n}\n","import { getCachedDocumentNodeFromSchema } from '@graphql-codegen/plugin-helpers';\nimport { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';\nimport {\n\ttype UnnormalizedTypeDefPointer,\n\tloadSchema as loadSchemaToolkit,\n} from '@graphql-tools/load';\nimport type { BaseLoaderOptions, Loader } from '@graphql-tools/utils';\nimport { type GraphQLSchemaExtensions, validateSchema } from 'graphql';\nimport { hashSchema } from './hash.ts';\n\nexport async function loadSchema(\n\tschemaPointerMap: UnnormalizedTypeDefPointer,\n\tcwd: string,\n\textraLoaders: Loader<BaseLoaderOptions>[] = [],\n) {\n\tconst outputSchemaAst = await loadSchemaToolkit(schemaPointerMap, {\n\t\tloaders: [new GraphQLFileLoader(), ...extraLoaders],\n\t\tcwd,\n\t\tincludeSources: true,\n\t});\n\n\tconst errors = validateSchema(outputSchemaAst);\n\n\tif (errors.length > 0) {\n\t\tconst messages = errors.map((e) => e.toString()).join('\\n\\n--------------------\\n\\n');\n\t\tconst subject = errors.length === 1 ? 'error' : 'errors';\n\t\tthrow new Error(`Invalid schema. Found ${errors.length} ${subject}:\\n\\n${messages}`);\n\t}\n\n\tif (!outputSchemaAst.extensions) {\n\t\toutputSchemaAst.extensions = {};\n\t}\n\n\t(outputSchemaAst.extensions as GraphQLSchemaExtensions).hash = hashSchema(outputSchemaAst);\n\n\treturn {\n\t\toutputSchemaAst,\n\t\toutputSchema: getCachedDocumentNodeFromSchema(outputSchemaAst),\n\t};\n}\n","import { createHash } from 'node:crypto';\nimport { getCachedDocumentNodeFromSchema } from '@graphql-codegen/plugin-helpers';\nimport { type GraphQLSchema, print } from 'graphql';\n\nexport function hashContent(content: string): string {\n\treturn createHash('sha256').update(content).digest('hex');\n}\n\nexport function hashSchema(schema: GraphQLSchema): string {\n\treturn hashContent(print(getCachedDocumentNodeFromSchema(schema)));\n}\n","import { dirname, isAbsolute, joinSafe, relative } from '@baeta/util-path';\nimport { parseMapper } from '@graphql-codegen/visitor-plugin-common';\n\nexport function buildScalarMap(\n\tmap: Record<string, string> | undefined,\n\tcwd: string,\n\ttypesPath: string,\n) {\n\tif (!map) {\n\t\treturn {};\n\t}\n\n\tconst fixedMap: Record<string, string> = {};\n\n\tfor (const key in map) {\n\t\tconst mapped = parseMapper(map[key]);\n\n\t\tif (!mapped.isExternal) {\n\t\t\tfixedMap[key] = map[key];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isAbsolute(mapped.source)) {\n\t\t\tfixedMap[key] = map[key];\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst scalarPath = joinSafe(cwd, mapped.source);\n\t\tconst relativePath = relative(dirname(typesPath), scalarPath);\n\n\t\tif (mapped.default) {\n\t\t\tfixedMap[key] = `${relativePath}#default`;\n\t\t\tcontinue;\n\t\t}\n\n\t\tfixedMap[key] = `${relativePath}#${mapped.import}`;\n\t}\n\n\treturn fixedMap;\n}\n","import type { PluginFunction, Types } from '@graphql-codegen/plugin-helpers';\nimport { buildMapperImport, parseMapper } from '@graphql-codegen/visitor-plugin-common';\nimport type { GraphQLSchema } from 'graphql';\n\ninterface Config {\n\tcontextType: string | undefined;\n}\n\nexport const plugin: PluginFunction<Config> = async (\n\tschema: GraphQLSchema,\n\tdocuments: Types.DocumentFile[],\n\tconfig: Config,\n): Promise<Types.PluginOutput> => {\n\tconst prepend: string[] = [];\n\tconst mapper = parseMapper(config.contextType || 'any');\n\n\tif (mapper.isExternal && mapper.source) {\n\t\tconst identifier = mapper.default ? 'ContextType' : `${mapper.import} as ContextType`;\n\n\t\tconst result = buildMapperImport(\n\t\t\tmapper.source,\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tidentifier,\n\t\t\t\t\tasDefault: mapper.default,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttrue,\n\t\t);\n\n\t\tif (result) {\n\t\t\tprepend.push(result);\n\t\t}\n\t} else {\n\t\tprepend.push(`type ContextType = ${mapper.type}`);\n\t}\n\n\tprepend.push('export type { ContextType }');\n\n\treturn {\n\t\tcontent: '',\n\t\tprepend: prepend,\n\t};\n};\n\nexport default { plugin };\n","/**\n * Originally based on graphql-modules preset of graphql-code-generator\n * Source: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/graphql-modules/src/index.ts\n * Copyright (c) 2016 Dotan Simha\n * Modified by Baeta developers\n */\nimport { basename, join, relative, resolve } from '@baeta/util-path';\nimport type { Types } from '@graphql-codegen/plugin-helpers';\nimport { BaseVisitor, getConfigValue } from '@graphql-codegen/visitor-plugin-common';\nimport type { Source } from '@graphql-tools/utils';\nimport {\n\ttype DocumentNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype UnionTypeDefinitionNode,\n\ttype UnionTypeExtensionNode,\n\tconcatAST,\n\tisScalarType,\n} from 'graphql';\nimport { buildModule } from './builder.ts';\nimport type { ModulesConfig } from './config.ts';\nimport {\n\tcollectObjectFieldTypesAndArguments,\n\tgroupSourcesByModule,\n\tisGraphQLPrimitive,\n\tnormalize,\n\tstripFilename,\n} from './utils.ts';\n\nexport const preset: Types.OutputPreset<ModulesConfig> = {\n\tbuildGeneratesSection: (options) => {\n\t\tconst { baseOutputDir } = options;\n\t\tconst { baseTypesPath, extensionsPath, encapsulateModuleTypes, importExtension } =\n\t\t\toptions.presetConfig;\n\n\t\tconst requireRootResolvers = getConfigValue(options?.presetConfig.requireRootResolvers, false);\n\n\t\tconst cwd = resolve(options.presetConfig.cwd || process.cwd());\n\t\tconst importTypesNamespace = options.presetConfig.importTypesNamespace || 'Types';\n\n\t\tif (!baseTypesPath) {\n\t\t\tthrow new Error(\n\t\t\t\t`Preset \"graphql-modules\" requires you to specify \"baseTypesPath\" configuration and point it to your base types file (generated by \"typescript\" plugin)!`,\n\t\t\t);\n\t\t}\n\n\t\tif (!options.schemaAst?.extensions.sources) {\n\t\t\tthrow new Error(`Preset \"graphql-modules\" requires to use GraphQL SDL`);\n\t\t}\n\n\t\tconst extensions = options.schemaAst?.extensions;\n\t\tconst sources = (extensions?.extendedSources ?? []) as Source[];\n\t\tconst sourcesByModuleMap = groupSourcesByModule(sources, baseOutputDir);\n\t\tconst modules = Object.keys(sourcesByModuleMap);\n\n\t\tconst baseVisitor = new BaseVisitor(options.config, {});\n\t\tconst { fieldTypes, fieldArguments } = collectObjectFieldTypesAndArguments(options.schemaAst);\n\n\t\t// One file with an output from all plugins\n\t\tconst baseOutput: Types.GenerateOptions = {\n\t\t\tfilename: resolve(cwd, baseOutputDir, baseTypesPath),\n\t\t\tschema: options.schema,\n\t\t\tdocuments: options.documents,\n\t\t\tplugins: [\n\t\t\t\t...options.plugins,\n\t\t\t\t{\n\t\t\t\t\t'modules-exported-scalars': {},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t'modules-exported-picks': {},\n\t\t\t\t},\n\t\t\t],\n\t\t\tpluginMap: {\n\t\t\t\t...options.pluginMap,\n\t\t\t\t'modules-exported-scalars': {\n\t\t\t\t\tplugin: (schema) => {\n\t\t\t\t\t\tconst typeMap = schema.getTypeMap();\n\n\t\t\t\t\t\treturn Object.keys(typeMap)\n\t\t\t\t\t\t\t.map((t) => {\n\t\t\t\t\t\t\t\tif (t && typeMap[t] && isScalarType(typeMap[t]) && !isGraphQLPrimitive(t)) {\n\t\t\t\t\t\t\t\t\tconst convertedName = baseVisitor.convertName(t);\n\t\t\t\t\t\t\t\t\treturn `export type ${convertedName} = Scalars[\"${t}\"];`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t'modules-exported-picks': {\n\t\t\t\t\tplugin: (schema) => {\n\t\t\t\t\t\tconst typePicks: string[] = [];\n\t\t\t\t\t\tconst unionPicks: string[] = [];\n\t\t\t\t\t\tconst unionResults: string[] = [];\n\t\t\t\t\t\tconst interfacePicks: string[] = [];\n\t\t\t\t\t\tconst interfaceResults: string[] = [];\n\n\t\t\t\t\t\tconst unionTypesMap: Record<string, string[] | undefined> = {};\n\t\t\t\t\t\tconst interfacesTypesMap: Record<string, string[] | undefined> = {};\n\n\t\t\t\t\t\tfor (const moduleName of modules) {\n\t\t\t\t\t\t\tconst sources = sourcesByModuleMap[moduleName];\n\t\t\t\t\t\t\tconst documents = sources.map((source) => source.document) as DocumentNode[];\n\t\t\t\t\t\t\tconst moduleDocument = concatAST(documents);\n\n\t\t\t\t\t\t\tconst types = moduleDocument.definitions.filter(\n\t\t\t\t\t\t\t\t(def) => def.kind === 'ObjectTypeDefinition',\n\t\t\t\t\t\t\t) as ObjectTypeDefinitionNode[];\n\n\t\t\t\t\t\t\tconst unionsDefinition = moduleDocument.definitions.filter(\n\t\t\t\t\t\t\t\t(def) => def.kind === 'UnionTypeDefinition',\n\t\t\t\t\t\t\t) as UnionTypeDefinitionNode[];\n\n\t\t\t\t\t\t\tconst unionsExtensions = moduleDocument.definitions.filter(\n\t\t\t\t\t\t\t\t(def) => def.kind === 'UnionTypeExtension',\n\t\t\t\t\t\t\t) as UnionTypeExtensionNode[];\n\n\t\t\t\t\t\t\tconst unions = [...unionsDefinition, ...unionsExtensions];\n\n\t\t\t\t\t\t\tfor (const type of types) {\n\t\t\t\t\t\t\t\tconst name = type.name.value;\n\n\t\t\t\t\t\t\t\tfor (const interfaceNode of type.interfaces ?? []) {\n\t\t\t\t\t\t\t\t\tconst interfaceName = interfaceNode.name.value;\n\n\t\t\t\t\t\t\t\t\tif (interfacesTypesMap[interfaceName] == null) {\n\t\t\t\t\t\t\t\t\t\tinterfacesTypesMap[interfaceName] = [];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tinterfacesTypesMap[interfaceName]?.push(name);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (name === 'Query' || name === 'Mutation' || name === 'Subscription') {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst fields = type.fields ?? [];\n\n\t\t\t\t\t\t\t\tif (fields.length === 0) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst fieldNames = fields.map((f) => `\"${f.name.value}\"`).join(' | ');\n\n\t\t\t\t\t\t\t\ttypePicks.push(` ${name}: ${fieldNames};`);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (const union of unions) {\n\t\t\t\t\t\t\t\tconst types = union.types?.map((t) => t.name.value) ?? [];\n\n\t\t\t\t\t\t\t\tif (unionTypesMap[union.name.value] == null) {\n\t\t\t\t\t\t\t\t\tunionTypesMap[union.name.value] = [];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tunionTypesMap[union.name.value]?.push(...types);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const unionName in unionTypesMap) {\n\t\t\t\t\t\t\tconst types = unionTypesMap[unionName];\n\n\t\t\t\t\t\t\tif (types == null || types.length === 0) {\n\t\t\t\t\t\t\t\tunionPicks.push(` ${unionName}: never;`);\n\t\t\t\t\t\t\t\tunionResults.push(` ${unionName}: null;`);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst typePicks = types.map((t) => {\n\t\t\t\t\t\t\t\tconst normalizedTypeName = baseVisitor.convertName(t, {\n\t\t\t\t\t\t\t\t\tuseTypesSuffix: true,\n\t\t\t\t\t\t\t\t\tuseTypesPrefix: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn `Pick<${normalizedTypeName}, DefinedFieldsWithoutExtensions[\"${t}\"] | \"__typename\">`;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst resultPicks = types.map((t) => `\"${t}\"`);\n\n\t\t\t\t\t\t\tunionPicks.push(` ${unionName}: ${typePicks.join(' | ')};`);\n\t\t\t\t\t\t\tunionResults.push(` ${unionName}: ${resultPicks.join(' | ')} | null;`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const interfaceName in interfacesTypesMap) {\n\t\t\t\t\t\t\tconst types = interfacesTypesMap[interfaceName];\n\n\t\t\t\t\t\t\tif (types == null || types.length === 0) {\n\t\t\t\t\t\t\t\tinterfacePicks.push(` ${interfaceName}: never;`);\n\t\t\t\t\t\t\t\tinterfaceResults.push(` ${interfaceName}: null;`);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst typePicks = types.map((t) => {\n\t\t\t\t\t\t\t\tconst normalizedTypeName = baseVisitor.convertName(t, {\n\t\t\t\t\t\t\t\t\tuseTypesSuffix: true,\n\t\t\t\t\t\t\t\t\tuseTypesPrefix: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn `Pick<${normalizedTypeName}, DefinedFieldsWithoutExtensions[\"${t}\"] | \"__typename\">`;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst resultPicks = types.map((t) => `\"${t}\"`);\n\n\t\t\t\t\t\t\tinterfacePicks.push(` ${interfaceName}: ${typePicks.join(' | ')};`);\n\t\t\t\t\t\t\tinterfaceResults.push(` ${interfaceName}: ${resultPicks.join(' | ')} | null;`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst fieldsDefinition = `export type DefinedFieldsWithoutExtensions = {\\n${typePicks.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst unionsDefinition = `export type DefinedUnionsWithoutExtensions = {\\n${unionPicks.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst unionsResultsDefinition = `export type DefinedUnionsResults = {\\n${unionResults.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst interfacesDefinition = `export type DefinedInterfacesWithoutExtensions = {\\n${interfacePicks.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst interfacesResultsDefinition = `export type DefinedInterfacesResults = {\\n${interfaceResults.join(\n\t\t\t\t\t\t\t'\\n',\n\t\t\t\t\t\t)}\\n};`;\n\n\t\t\t\t\t\tconst result = [\n\t\t\t\t\t\t\tfieldsDefinition,\n\t\t\t\t\t\t\tunionsDefinition,\n\t\t\t\t\t\t\tunionsResultsDefinition,\n\t\t\t\t\t\t\tinterfacesDefinition,\n\t\t\t\t\t\t\tinterfacesResultsDefinition,\n\t\t\t\t\t\t].join('\\n\\n');\n\n\t\t\t\t\t\treturn `\\n${result}\\n`;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tconfig: {\n\t\t\t\t...options.config,\n\t\t\t\tenumsAsTypes: true,\n\t\t\t},\n\t\t\tschemaAst: options.schemaAst,\n\t\t};\n\n\t\tconst baseTypesFilename =\n\t\t\tbasename(baseTypesPath).replace(/\\.(js|ts|d.ts)$/, '') + (importExtension || '');\n\t\tconst baseTypesDir = stripFilename(baseOutput.filename);\n\n\t\t// One file per each module\n\t\tconst outputs: Types.GenerateOptions[] = modules.map((moduleName) => {\n\t\t\tconst filename = resolve(cwd, baseOutputDir, moduleName, options.presetConfig.filename);\n\t\t\tconst dirpath = stripFilename(filename);\n\t\t\tconst relativePath = relative(dirpath, baseTypesDir);\n\t\t\tconst importPath =\n\t\t\t\toptions.presetConfig.importBaseTypesFrom ||\n\t\t\t\tnormalize(join(relativePath, baseTypesFilename));\n\t\t\tconst sources = sourcesByModuleMap[moduleName];\n\n\t\t\tconst documents = sources.map((source) => source.document) as DocumentNode[];\n\n\t\t\tconst moduleDocument = concatAST(documents);\n\n\t\t\tconst shouldDeclare = filename.endsWith('.d.ts');\n\n\t\t\treturn {\n\t\t\t\tfilename,\n\t\t\t\tschema: options.schema,\n\t\t\t\tdocuments: [],\n\t\t\t\tplugins: [\n\t\t\t\t\t...options.plugins.filter((p) => typeof p === 'object' && !!p.add),\n\t\t\t\t\t{\n\t\t\t\t\t\t'graphql-modules-plugin': {},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tpluginMap: {\n\t\t\t\t\t...options.pluginMap,\n\t\t\t\t\t'graphql-modules-plugin': {\n\t\t\t\t\t\tplugin: (schema) =>\n\t\t\t\t\t\t\tbuildModule(moduleName, moduleDocument, {\n\t\t\t\t\t\t\t\timportNamespace: importTypesNamespace,\n\t\t\t\t\t\t\t\timportPath,\n\t\t\t\t\t\t\t\tencapsulate: encapsulateModuleTypes || 'namespace',\n\t\t\t\t\t\t\t\trequireRootResolvers,\n\t\t\t\t\t\t\t\tshouldDeclare,\n\t\t\t\t\t\t\t\tschema,\n\t\t\t\t\t\t\t\tbaseVisitor,\n\t\t\t\t\t\t\t\tuseGraphQLModules: false,\n\t\t\t\t\t\t\t\tfieldTypes,\n\t\t\t\t\t\t\t\tfieldArguments,\n\t\t\t\t\t\t\t\textensionsPath,\n\t\t\t\t\t\t\t\trootTypes: [\n\t\t\t\t\t\t\t\t\tschema.getQueryType()?.name || '',\n\t\t\t\t\t\t\t\t\tschema.getMutationType()?.name || '',\n\t\t\t\t\t\t\t\t\tschema.getSubscriptionType()?.name || '',\n\t\t\t\t\t\t\t\t].filter(Boolean),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tconfig: options.config,\n\t\t\t\tschemaAst: options.schemaAst,\n\t\t\t};\n\t\t});\n\n\t\treturn [baseOutput].concat(outputs);\n\t},\n};\n\nexport default preset;\n","/**\n * Originally based on graphql-modules preset of graphql-code-generator\n * Source: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/graphql-modules/src/builder.ts\n * Copyright (c) 2016 Dotan Simha\n * Modified by Baeta developers\n */\nimport type { BaseVisitor } from '@graphql-codegen/visitor-plugin-common';\nimport { pascalCase } from 'change-case-all';\nimport {\n\ttype DocumentNode,\n\ttype EnumTypeDefinitionNode,\n\ttype EnumTypeExtensionNode,\n\ttype GraphQLSchema,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InputObjectTypeExtensionNode,\n\ttype InterfaceTypeDefinitionNode,\n\ttype InterfaceTypeExtensionNode,\n\tKind,\n\ttype ObjectTypeDefinitionNode,\n\ttype ObjectTypeExtensionNode,\n\ttype TypeDefinitionNode,\n\ttype TypeExtensionNode,\n\ttype UnionTypeDefinitionNode,\n\tisInterfaceType,\n\tisScalarType,\n\tisUnionType,\n\tvisit,\n} from 'graphql';\nimport type { ModulesConfig } from './config.ts';\nimport { type TypeHash, getObjectTypeHash } from './hashes.ts';\nimport {\n\tbuildBlock,\n\tcollectUsedTypes,\n\tconcatByKey,\n\tcreateObject,\n\tindent,\n\tpushUnique,\n\tunique,\n\tuniqueByKey,\n\twithQuotes,\n} from './utils.ts';\n\ntype RegistryKeys = 'objects' | 'inputs' | 'interfaces' | 'scalars' | 'unions' | 'enums';\ntype Registry = Record<RegistryKeys, string[]>;\nconst registryKeys: RegistryKeys[] = [\n\t'objects',\n\t'inputs',\n\t'interfaces',\n\t'scalars',\n\t'unions',\n\t'enums',\n];\nconst resolverKeys: Extract<RegistryKeys, 'objects' | 'enums' | 'scalars'>[] = [\n\t'scalars',\n\t'objects',\n\t'enums',\n];\n\nexport function buildModule(\n\tname: string,\n\tdoc: DocumentNode,\n\t{\n\t\timportNamespace,\n\t\timportPath,\n\t\tencapsulate,\n\t\trequireRootResolvers,\n\t\tshouldDeclare,\n\t\trootTypes,\n\t\tschema,\n\t\tbaseVisitor,\n\t\tfieldTypes,\n\t\tfieldArguments,\n\t\textensionsPath,\n\t}: {\n\t\timportNamespace: string;\n\t\timportPath: string;\n\t\tencapsulate: ModulesConfig['encapsulateModuleTypes'];\n\t\trequireRootResolvers: ModulesConfig['requireRootResolvers'];\n\t\tshouldDeclare: boolean;\n\t\trootTypes: string[];\n\t\tbaseVisitor: BaseVisitor;\n\t\tschema?: GraphQLSchema;\n\t\tuseGraphQLModules: boolean;\n\t\tfieldTypes: Record<string, Record<string, string>>;\n\t\tfieldArguments: Record<string, Record<string, boolean>>;\n\t\textensionsPath?: string;\n\t},\n): string {\n\tconst picks: Record<RegistryKeys, Record<string, string[]>> = createObject(\n\t\tregistryKeys,\n\t\t() => ({}),\n\t);\n\tconst defined: Registry = createObject(registryKeys, () => []);\n\tconst extended: Registry = createObject(registryKeys, () => []);\n\n\tconst hashes: Record<string, TypeHash> = {};\n\n\t// List of types used in objects, fields, arguments etc\n\tconst usedTypes = collectUsedTypes(doc);\n\n\tvisit(doc, {\n\t\tObjectTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tObjectTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tInputObjectTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tInputObjectTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tInterfaceTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tInterfaceTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tScalarTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tUnionTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tUnionTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tEnumTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tEnumTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t});\n\n\t// Defined and Extended types\n\tconst visited: Registry = createObject(registryKeys, (key) =>\n\t\tconcatByKey(defined, extended, key),\n\t);\n\n\t// Types that are not defined or extended in a module, they come from other modules\n\tconst external: Registry = createObject(registryKeys, (key) =>\n\t\tuniqueByKey(extended, defined, key),\n\t);\n\n\t//\n\t//\n\t//\n\t// Prints\n\t//\n\t//\n\t//\n\n\t// An actual output\n\tconst imports = [\n\t\t`import * as ${importNamespace} from \"${importPath}\";`,\n\t\t'import type { DocumentNode } from \"graphql\";',\n\t\t'import * as Baeta from \"@baeta/core/sdk\";',\n\t];\n\n\tif (extensionsPath) {\n\t\timports.push(`import baetaExtensions from \"${extensionsPath}\";`);\n\t}\n\n\timports.push('\\n');\n\n\tlet content = [\n\t\tprintDefinedFields(),\n\t\tprintDefinedEnumValues(),\n\t\tprintDefinedInputFields(),\n\t\tprintSchemaTypes(usedTypes),\n\t\tprintMetadata(),\n\t]\n\t\t.filter(Boolean)\n\t\t.join('\\n\\n');\n\n\tconst moduleNamespace = baseVisitor.convertName(name, {\n\t\tsuffix: 'Module',\n\t\tuseTypesPrefix: false,\n\t\tuseTypesSuffix: false,\n\t});\n\n\tif (encapsulate === 'namespace') {\n\t\tcontent = `${shouldDeclare ? 'declare' : 'export'} namespace ${baseVisitor.convertName(name, {\n\t\t\tsuffix: 'Module',\n\t\t\tuseTypesPrefix: false,\n\t\t\tuseTypesSuffix: false,\n\t\t})} {\\n${shouldDeclare ? `${indent(2)(imports.join('\\n'))}\\n` : ''}${indent(2)(content)}\\n}`;\n\t}\n\n\treturn [...(shouldDeclare ? [] : imports), content, printFactoryMethod()]\n\t\t.filter(Boolean)\n\t\t.join('\\n');\n\n\tfunction printMetadata() {\n\t\treturn `export namespace ModuleMetadata {\n export const id = '${name}';\n export const dirname = './${name}';\n export const hashes = ${JSON.stringify(hashes)};\n export const typedef = ${JSON.stringify(doc)} as unknown as DocumentNode;\n ${printBaetaManager()}\n}`;\n\t}\n\n\t/**\n\t * A dictionary of fields to pick from an object\n\t */\n\tfunction printDefinedFields() {\n\t\treturn buildBlock({\n\t\t\tname: 'interface DefinedFields',\n\t\t\tlines: [...visited.objects, ...visited.interfaces].map(\n\t\t\t\t(typeName) =>\n\t\t\t\t\t`${typeName}: ${printPicks(typeName, {\n\t\t\t\t\t\t...picks.objects,\n\t\t\t\t\t\t...picks.interfaces,\n\t\t\t\t\t})};`,\n\t\t\t),\n\t\t});\n\t}\n\n\tfunction printFactoryMethod() {\n\t\tconst name = moduleNamespace.slice(0, moduleNamespace.length - 6);\n\t\tconst createModuleFn = `create${name}Module`;\n\t\tconst getModuleFn = `get${name}Module`;\n\t\tconst extensionsArg = extensionsPath ? ', baetaExtensions' : '';\n\n\t\treturn `\nexport const ${createModuleFn} = () => Baeta.createModuleManager(ModuleMetadata${extensionsArg});\nexport const ${getModuleFn} = Baeta.createSingletonModule(${createModuleFn});\n`;\n\t}\n\n\t/**\n\t * Baeta manager\n\t */\n\n\tfunction printObjectFieldResolverBuilder(typeName: string, field: string) {\n\t\tconst parentType = getParentType(typeName);\n\t\tconst resultType = getResultType(typeName, field);\n\t\tconst argumentsType = getArgsType(typeName, field);\n\t\tconst contextType = getContextType();\n\t\treturn `${field}: module.createResolverBuilder<${resultType}, ${parentType}, ${contextType}, ${argumentsType}>(\"${typeName}\", \"${field}\"),`;\n\t}\n\n\tfunction printObjectResolverBuilder(typeName: string, objects: Record<string, string[]>) {\n\t\tconst fields =\n\t\t\tobjects[typeName]\n\t\t\t\t?.filter(unique)\n\t\t\t\t.map((field) => printObjectFieldResolverBuilder(typeName, field)) ?? [];\n\n\t\tif (fields.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst parentType = getParentType(typeName);\n\t\tconst contextType = getContextType();\n\n\t\tconst addons = [`...module.createTypeMethods<${parentType}, ${contextType}>(\"${typeName}\"),`];\n\t\tconst contentBody = [...addons, ...fields].map(indent(2)).join('\\n');\n\t\tconst content = `{\\n${contentBody}\\n}`;\n\t\treturn `${typeName}: ${content},`;\n\t}\n\n\tfunction printSubscriptionFieldBuilder(field: string) {\n\t\tconst parentType = getParentType('Subscription');\n\t\tconst resultType = getResultType('Subscription', field);\n\t\tconst argumentsType = getArgsType('Subscription', field);\n\t\tconst contextType = getContextType();\n\t\treturn `${field}: module.createSubscriptionBuilder<${resultType}, ${parentType}, ${contextType}, ${argumentsType}>(\"${field}\"),`;\n\t}\n\n\tfunction printSubscriptionObjectBuilder() {\n\t\tconst subscriptions = picks.objects.Subscription?.filter(unique) ?? [];\n\n\t\tif (subscriptions.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fields = subscriptions.map((subscription) => printSubscriptionFieldBuilder(subscription));\n\n\t\tconst parentType = getParentType('Subscription');\n\t\tconst contextType = getContextType();\n\t\tconst addons = [`...module.createSubscriptionMethods<${parentType}, ${contextType}>(),`];\n\t\tconst contentBody = [...addons, ...fields].map(indent(2)).join('\\n');\n\n\t\tconst content = `{\\n${contentBody}\\n}`;\n\t\treturn `Subscription: ${content},`;\n\t}\n\n\tfunction printScalarBuilder() {\n\t\tconst scalars = visited.scalars;\n\t\tif (scalars.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fields = scalars.map((scalar) => `${scalar}: module.createScalarBuilder(\"${scalar}\"),`);\n\t\tconst content = fields.map(indent(2)).join('\\n');\n\t\treturn `Scalar: {\\n${content}\\n},`;\n\t}\n\n\tfunction printTypenameResolverBuilder(\n\t\tname: string,\n\t\tresultNamespace: string,\n\t\tvalueNamespace: string,\n\t) {\n\t\tconst resultType = `${importNamespace}.${resultNamespace}[\"${name}\"]`;\n\t\tconst valueType = `${importNamespace}.${valueNamespace}[\"${name}\"]`;\n\t\tconst contextType = getContextType();\n\t\tconst resolver = `$resolveType: module.createResolveType<${resultType}, ${valueType}, ${contextType}>(\"${name}\"),`;\n\t\treturn `${name}: {\\n${indent(2)(resolver)}\\n},`;\n\t}\n\n\tfunction printInterfaceBuilder() {\n\t\tconst interfaces = defined.interfaces;\n\n\t\tif (interfaces.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn interfaces\n\t\t\t.map((interfaceName) =>\n\t\t\t\tprintTypenameResolverBuilder(\n\t\t\t\t\tinterfaceName,\n\t\t\t\t\t'DefinedInterfacesResults',\n\t\t\t\t\t'DefinedInterfacesWithoutExtensions',\n\t\t\t\t),\n\t\t\t)\n\t\t\t.join('\\n');\n\t}\n\n\tfunction printUnionBuilder() {\n\t\tconst unions = defined.unions;\n\n\t\tif (unions.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn unions\n\t\t\t.map((unionName) =>\n\t\t\t\tprintTypenameResolverBuilder(\n\t\t\t\t\tunionName,\n\t\t\t\t\t'DefinedUnionsResults',\n\t\t\t\t\t'DefinedUnionsWithoutExtensions',\n\t\t\t\t),\n\t\t\t)\n\t\t\t.join('\\n');\n\t}\n\n\tfunction printBaetaManager() {\n\t\tconst objects = visited.objects\n\t\t\t.filter((type) => type !== 'Subscription')\n\t\t\t.map((typeName) => printObjectResolverBuilder(typeName, picks.objects))\n\t\t\t.filter(Boolean);\n\n\t\tconst contextType = getContextType();\n\t\tconst addons = [`...module.createModuleMethods<${contextType}>(),`];\n\n\t\tconst bodyFields = [\n\t\t\t...addons,\n\t\t\t...objects,\n\t\t\tprintScalarBuilder(),\n\t\t\tprintSubscriptionObjectBuilder(),\n\t\t\tprintInterfaceBuilder(),\n\t\t\tprintUnionBuilder(),\n\t\t];\n\n\t\tconst body = bodyFields.filter(Boolean).map(indent(6)).join('\\n');\n\t\tconst content = `{\\n${body}\\n }`;\n\n\t\treturn `\n export function createManager(module: Baeta.ModuleBuilder) {\n return ${content};\n }`;\n\t}\n\n\t/**\n\t * A dictionary of values to pick from an enum\n\t */\n\tfunction printDefinedEnumValues() {\n\t\treturn buildBlock({\n\t\t\tname: 'interface DefinedEnumValues',\n\t\t\tlines: visited.enums.map((typeName) => `${typeName}: ${printPicks(typeName, picks.enums)};`),\n\t\t});\n\t}\n\n\tfunction encapsulateTypeName(typeName: string): string {\n\t\tif (encapsulate === 'prefix') {\n\t\t\treturn `${pascalCase(name)}_${typeName}`;\n\t\t}\n\n\t\treturn typeName;\n\t}\n\n\t/**\n\t * A dictionary of fields to pick from an input\n\t */\n\tfunction printDefinedInputFields() {\n\t\treturn buildBlock({\n\t\t\tname: 'interface DefinedInputFields',\n\t\t\tlines: visited.inputs.map(\n\t\t\t\t(typeName) => `${typeName}: ${printPicks(typeName, picks.inputs)};`,\n\t\t\t),\n\t\t});\n\t}\n\n\t/**\n\t * Prints signatures of schema types with picks\n\t */\n\tfunction printSchemaTypes(types: string[]) {\n\t\treturn types\n\t\t\t.filter((type) => !visited.scalars.includes(type))\n\t\t\t.map(printExportType)\n\t\t\t.join('\\n');\n\t}\n\n\tfunction printPicks(typeName: string, records: Record<string, string[]>): string {\n\t\treturn records[typeName].filter(unique).map(withQuotes).join(' | ');\n\t}\n\n\tfunction printTypeBody(typeName: string): string {\n\t\tconst normalizedTypeName = baseVisitor.convertName(typeName, {\n\t\t\tuseTypesSuffix: true,\n\t\t\tuseTypesPrefix: true,\n\t\t});\n\n\t\tconst coreType = `${importNamespace}.${normalizedTypeName}`;\n\n\t\tif (external.enums.includes(typeName) || external.objects.includes(typeName)) {\n\t\t\tif (schema && isScalarType(schema.getType(typeName))) {\n\t\t\t\treturn `${importNamespace}.Scalars['${typeName}']`;\n\t\t\t}\n\n\t\t\treturn `Pick<${coreType}, ${importNamespace}.DefinedFieldsWithoutExtensions[\"${typeName}\"]>`;\n\t\t}\n\n\t\tif (external.unions.includes(typeName)) {\n\t\t\treturn `${importNamespace}.DefinedUnionsWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (external.interfaces.includes(typeName)) {\n\t\t\treturn `Pick<${coreType}, ${importNamespace}.DefinedFieldsWithoutExtensions[\"${typeName}\"]>`;\n\t\t}\n\n\t\tif (defined.enums.includes(typeName) && picks.enums[typeName]) {\n\t\t\treturn `DefinedEnumValues['${typeName}']`;\n\t\t}\n\n\t\tif (defined.unions.includes(typeName) && picks.unions[typeName]) {\n\t\t\treturn `${importNamespace}.DefinedUnionsWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (defined.objects.includes(typeName) && picks.objects[typeName]) {\n\t\t\treturn `Pick<${coreType}, DefinedFields['${typeName}']>`;\n\t\t}\n\n\t\tif (defined.interfaces.includes(typeName) && picks.interfaces[typeName]) {\n\t\t\treturn `${importNamespace}.DefinedInterfacesWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (defined.inputs.includes(typeName) && picks.inputs[typeName]) {\n\t\t\treturn `Pick<${coreType}, DefinedInputFields['${typeName}']>`;\n\t\t}\n\n\t\tif (isScalarType(schema?.getType(typeName))) {\n\t\t\treturn coreType;\n\t\t}\n\n\t\tif (isInterfaceType(schema?.getType(typeName))) {\n\t\t\treturn `${importNamespace}.DefinedInterfacesWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (isUnionType(schema?.getType(typeName))) {\n\t\t\treturn `${importNamespace}.DefinedUnionsWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\treturn `Pick<${coreType}, ${importNamespace}.DefinedFieldsWithoutExtensions[\"${typeName}\"]>`;\n\t}\n\n\tfunction printExportType(typeName: string): string {\n\t\treturn `export type ${encapsulateTypeName(typeName)} = ${printTypeBody(typeName)};`;\n\t}\n\n\t//\n\t//\n\t//\n\t// Utils\n\t//\n\t//\n\t//\n\n\tfunction collectFields(\n\t\tnode:\n\t\t\t| ObjectTypeDefinitionNode\n\t\t\t| ObjectTypeExtensionNode\n\t\t\t| InterfaceTypeDefinitionNode\n\t\t\t| InterfaceTypeExtensionNode\n\t\t\t| InputObjectTypeDefinitionNode\n\t\t\t| InputObjectTypeExtensionNode,\n\t\tpicksObj: Record<string, string[]>,\n\t) {\n\t\tconst name = node.name.value;\n\n\t\tif (node.fields) {\n\t\t\tif (!picksObj[name]) {\n\t\t\t\tpicksObj[name] = [];\n\t\t\t}\n\n\t\t\tfor (const field of node.fields) {\n\t\t\t\tpicksObj[name].push(field.name.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectValuesFromEnum(node: EnumTypeDefinitionNode | EnumTypeExtensionNode) {\n\t\tconst name = node.name.value;\n\n\t\tif (node.values) {\n\t\t\tif (!picks.enums[name]) {\n\t\t\t\tpicks.enums[name] = [];\n\t\t\t}\n\n\t\t\tfor (const field of node.values) {\n\t\t\t\tpicks.enums[name].push(field.name.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectUnionTypes(node: UnionTypeDefinitionNode) {\n\t\tconst name = node.name.value;\n\n\t\tif (node.types) {\n\t\t\tif (!picks.unions[name]) {\n\t\t\t\tpicks.unions[name] = [];\n\t\t\t}\n\n\t\t\tfor (const type of node.types) {\n\t\t\t\tpicks.unions[name].push(type.name.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectTypeDefinition(node: TypeDefinitionNode) {\n\t\tconst name = node.name.value;\n\n\t\tswitch (node.kind) {\n\t\t\tcase Kind.OBJECT_TYPE_DEFINITION: {\n\t\t\t\tdefined.objects.push(name);\n\t\t\t\tcollectFields(node, picks.objects);\n\t\t\t\thashes[name] = getObjectTypeHash(node);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.ENUM_TYPE_DEFINITION: {\n\t\t\t\tdefined.enums.push(name);\n\t\t\t\tcollectValuesFromEnum(node);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INPUT_OBJECT_TYPE_DEFINITION: {\n\t\t\t\tdefined.inputs.push(name);\n\t\t\t\tcollectFields(node, picks.inputs);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.SCALAR_TYPE_DEFINITION: {\n\t\t\t\tdefined.scalars.push(name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INTERFACE_TYPE_DEFINITION: {\n\t\t\t\tdefined.interfaces.push(name);\n\t\t\t\tcollectFields(node, picks.interfaces);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.UNION_TYPE_DEFINITION: {\n\t\t\t\tdefined.unions.push(name);\n\t\t\t\tcollectUnionTypes(node);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectTypeExtension(node: TypeExtensionNode) {\n\t\tconst name = node.name.value;\n\n\t\tswitch (node.kind) {\n\t\t\tcase Kind.OBJECT_TYPE_EXTENSION: {\n\t\t\t\tcollectFields(node, picks.objects);\n\t\t\t\thashes[name] = getObjectTypeHash(node);\n\n\t\t\t\t// Do not include root types as extensions\n\t\t\t\t// so we can use them in DefinedFields\n\t\t\t\tif (rootTypes.includes(name)) {\n\t\t\t\t\tpushUnique(defined.objects, name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpushUnique(extended.objects, name);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.ENUM_TYPE_EXTENSION: {\n\t\t\t\tcollectValuesFromEnum(node);\n\t\t\t\tpushUnique(extended.enums, name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INPUT_OBJECT_TYPE_EXTENSION: {\n\t\t\t\tcollectFields(node, picks.inputs);\n\t\t\t\tpushUnique(extended.inputs, name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INTERFACE_TYPE_EXTENSION: {\n\t\t\t\tcollectFields(node, picks.interfaces);\n\t\t\t\tpushUnique(extended.interfaces, name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.UNION_TYPE_EXTENSION: {\n\t\t\t\tpushUnique(extended.unions, name);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction getParentType(type: string) {\n\t\tif (['Query', 'Mutation', 'Subscription'].includes(type)) {\n\t\t\treturn '{ }';\n\t\t}\n\t\treturn type;\n\t}\n\n\tfunction getResultType(type: string, field: string) {\n\t\treturn fieldTypes?.[type]?.[field] || '{ }';\n\t}\n\n\tfunction getArgsType(type: string, field: string) {\n\t\tconst hasArgs = fieldArguments?.[type]?.[field] ?? false;\n\t\tif (!hasArgs) {\n\t\t\treturn '{ }';\n\t\t}\n\t\tconst fieldUpper = field[0].toUpperCase() + field.slice(1);\n\t\treturn `Types.${type}${fieldUpper}Args`;\n\t}\n\n\tfunction getContextType() {\n\t\treturn 'Types.ContextType';\n\t}\n}\n","import {\n\ttype FieldDefinitionNode,\n\tKind,\n\ttype ObjectTypeDefinitionNode,\n\ttype ObjectTypeExtensionNode,\n\ttype TypeNode,\n} from 'graphql';\nimport hash from 'murmurhash';\n\nexport type TypeHash = {\n\thash: string;\n\tfieldsHashes: Record<string, string>;\n};\n\nexport function getObjectTypeHash(\n\tnode: ObjectTypeDefinitionNode | ObjectTypeExtensionNode,\n): TypeHash {\n\tconst fieldNames = buildFieldsNames(node.fields);\n\tconst typeFields = fieldNames\n\t\t.map(([fieldName, fieldType]) => `${fieldName}:${fieldType}`)\n\t\t.join(',');\n\n\tconst fieldMap: Record<string, string> = {};\n\n\tfor (const [fieldName, fieldType] of fieldNames) {\n\t\tfieldMap[fieldName] = hash.v3(fieldType).toString(36);\n\t}\n\n\treturn {\n\t\thash: hash.v3(typeFields).toString(36),\n\t\tfieldsHashes: fieldMap,\n\t};\n}\n\nfunction buildFieldsNames(fields: readonly FieldDefinitionNode[] = []) {\n\tif (fields.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst fieldsNames: Array<[string, string]> = [];\n\n\tfor (const field of fields) {\n\t\tconst fieldName = field.name.value;\n\t\tconst fieldType = buildTypeName(field.type);\n\t\tfieldsNames.push([fieldName, fieldType]);\n\t}\n\n\treturn fieldsNames.sort(([a], [b]) => a.localeCompare(b));\n}\n\nfunction buildTypeName(node: TypeNode): string {\n\tif (node.kind === Kind.NAMED_TYPE) {\n\t\treturn node.name.value;\n\t}\n\n\tif (node.kind === Kind.LIST_TYPE) {\n\t\treturn `[${buildTypeName(node.type)}]`;\n\t}\n\n\tif (node.kind === Kind.NON_NULL_TYPE) {\n\t\treturn `${buildTypeName(node.type)}!`;\n\t}\n\n\treturn '';\n}\n","/**\n * Originally based on graphql-modules preset of graphql-code-generator\n * Source: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/graphql-modules/src/utils.ts\n * Copyright (c) 2016 Dotan Simha\n * Modified by Baeta developers\n */\nimport { platform } from 'node:os';\nimport { getBaseType } from '@graphql-codegen/plugin-helpers';\nimport { DEFAULT_SCALARS, wrapTypeWithModifiers } from '@graphql-codegen/visitor-plugin-common';\nimport type { Source } from '@graphql-tools/utils';\nimport {\n\ttype DefinitionNode,\n\ttype DocumentNode,\n\ttype FieldDefinitionNode,\n\ttype GraphQLFieldMap,\n\ttype GraphQLObjectType,\n\ttype GraphQLSchema,\n\ttype InputValueDefinitionNode,\n\tKind,\n\ttype NamedTypeNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype TypeNode,\n} from 'graphql';\nimport parse from 'parse-filepath';\n\nconst sep = '/';\n\n/**\n * Searches every node to collect used types\n */\nexport function collectUsedTypes(doc: DocumentNode): string[] {\n\tconst used: string[] = [];\n\n\tfor (const definition of doc.definitions) {\n\t\tfindRelated(definition);\n\t}\n\n\tfunction markAsUsed(type: string) {\n\t\tpushUnique(used, type);\n\t}\n\n\tfunction findRelated(\n\t\tnode: DefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | NamedTypeNode,\n\t) {\n\t\tif (node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_EXTENSION) {\n\t\t\t// Object\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.fields) {\n\t\t\t\tfor (const field of node.fields) {\n\t\t\t\t\tfindRelated(field);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node.interfaces) {\n\t\t\t\tfor (const _interface of node.interfaces) {\n\t\t\t\t\tfindRelated(_interface);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Input\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.fields) {\n\t\t\t\tfor (const field of node.fields) {\n\t\t\t\t\tfindRelated(field);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.INTERFACE_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Interface\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.fields) {\n\t\t\t\tfor (const field of node.fields) {\n\t\t\t\t\tfindRelated(field);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node.interfaces) {\n\t\t\t\tfor (const _interface of node.interfaces) {\n\t\t\t\t\tfindRelated(_interface);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.UNION_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.UNION_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Union\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.types) {\n\t\t\t\tfor (const type of node.types) {\n\t\t\t\t\tfindRelated(type);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_EXTENSION) {\n\t\t\t// Enum\n\t\t\tmarkAsUsed(node.name.value);\n\t\t} else if (\n\t\t\tnode.kind === Kind.SCALAR_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.SCALAR_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Scalar\n\t\t\tif (!isGraphQLPrimitive(node.name.value)) {\n\t\t\t\tmarkAsUsed(node.name.value);\n\t\t\t}\n\t\t} else if (node.kind === Kind.INPUT_VALUE_DEFINITION) {\n\t\t\t// Argument\n\t\t\tfindRelated(resolveTypeNode(node.type));\n\t\t} else if (node.kind === Kind.FIELD_DEFINITION) {\n\t\t\t// Field\n\t\t\tfindRelated(resolveTypeNode(node.type));\n\n\t\t\tif (node.arguments) {\n\t\t\t\tfor (const argument of node.arguments) {\n\t\t\t\t\tfindRelated(argument);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.NAMED_TYPE &&\n\t\t\t// Named type\n\t\t\t!isGraphQLPrimitive(node.name.value)\n\t\t) {\n\t\t\tmarkAsUsed(node.name.value);\n\t\t}\n\t}\n\n\treturn used;\n}\n\nfunction collectObjectFieldType(\n\tnode: ObjectTypeDefinitionNode,\n\tfieldDefinition: FieldDefinitionNode,\n\tfieldsMap: GraphQLFieldMap<unknown, unknown>,\n\tfieldTypes: Record<string, Record<string, string>>,\n) {\n\tconst objectName = node.name.value;\n\tconst fieldName = fieldDefinition.name.value;\n\n\tconst field = fieldsMap[fieldDefinition.name.value];\n\tconst baseName = getBaseType(field.type).name;\n\tconst isDefaultScalar = DEFAULT_SCALARS[baseName] != null;\n\tconst name = isDefaultScalar ? `Types.Scalars[\"${baseName}\"][\"output\"]` : baseName;\n\n\tconst type = wrapTypeWithModifiers(name, field.type, {\n\t\twrapOptional: (str: string) => {\n\t\t\treturn `Types.Maybe<${str}>`;\n\t\t},\n\t\twrapArray: (str: string) => {\n\t\t\treturn `Array<${str}>`;\n\t\t},\n\t});\n\n\tif (fieldTypes[objectName] == null) {\n\t\tfieldTypes[objectName] = {};\n\t}\n\tfieldTypes[objectName][fieldName] = type;\n}\n\nfunction collectObjectFieldArguments(\n\tnode: ObjectTypeDefinitionNode,\n\tfieldDefinition: FieldDefinitionNode,\n\tfieldArguments: Record<string, Record<string, boolean>>,\n) {\n\tconst objectName = node.name.value;\n\tconst fieldName = fieldDefinition.name.value;\n\tconst hasArguments = fieldDefinition.arguments != null && fieldDefinition.arguments.length > 0;\n\n\tif (fieldArguments[objectName] == null) {\n\t\tfieldArguments[objectName] = {};\n\t}\n\tfieldArguments[objectName][fieldName] = hasArguments;\n}\n\nexport function collectObjectFieldTypesAndArguments(schema?: GraphQLSchema) {\n\tconst fieldTypes: Record<string, Record<string, string>> = {};\n\tconst fieldArguments: Record<string, Record<string, boolean>> = {};\n\n\tif (!schema) {\n\t\treturn { fieldTypes, fieldArguments };\n\t}\n\n\tconst schemaTypes = schema.getTypeMap();\n\n\tfor (const type of Object.values(schemaTypes)) {\n\t\tif (type.astNode?.kind !== Kind.OBJECT_TYPE_DEFINITION) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst schemaType = schemaTypes[type.name] as GraphQLObjectType;\n\t\tconst fieldsMap = schemaType.getFields();\n\n\t\tfor (const field of type.astNode.fields ?? []) {\n\t\t\tcollectObjectFieldArguments(type.astNode, field, fieldArguments);\n\t\t\tcollectObjectFieldType(type.astNode, field, fieldsMap, fieldTypes);\n\t\t}\n\t}\n\n\treturn { fieldTypes, fieldArguments };\n}\n\nexport function resolveTypeNode(node: TypeNode): NamedTypeNode {\n\tif (node.kind === Kind.LIST_TYPE) {\n\t\treturn resolveTypeNode(node.type);\n\t}\n\n\tif (node.kind === Kind.NON_NULL_TYPE) {\n\t\treturn resolveTypeNode(node.type);\n\t}\n\n\treturn node;\n}\n\nexport function isGraphQLPrimitive(name: string): boolean {\n\treturn ['String', 'Boolean', 'ID', 'Float', 'Int'].includes(name);\n}\n\nexport function unique<T>(val: T, i: number, all: T[]): boolean {\n\treturn i === all.indexOf(val);\n}\n\nexport function withQuotes(val: string): string {\n\treturn `'${val}'`;\n}\n\nexport function indent(size: number) {\n\tconst space = new Array(size).fill(' ').join('');\n\n\tfunction indentInner(val: string): string {\n\t\treturn val\n\t\t\t.split('\\n')\n\t\t\t.map((line) => `${space}${line}`)\n\t\t\t.join('\\n');\n\t}\n\n\treturn indentInner;\n}\n\nexport function buildBlock({ name, lines }: { name: string; lines: string[] }): string {\n\tif (!lines.length) {\n\t\treturn '';\n\t}\n\n\treturn [`${name} {`, ...lines.map(indent(2)), '};'].join('\\n');\n}\n\nconst getRelativePath = (filepath: string, basePath: string) => {\n\tconst normalizedFilepath = normalize(filepath);\n\tconst normalizedBasePath = ensureStartsWithSeparator(\n\t\tnormalize(ensureEndsWithSeparator(basePath)),\n\t);\n\tconst [, relativePath] = normalizedFilepath.split(normalizedBasePath);\n\treturn relativePath;\n};\n\nexport function groupSourcesByModule(\n\tsources: Source[],\n\tbasePath: string,\n): Record<string, Source[]> {\n\tconst grouped: Record<string, Source[]> = {};\n\n\tfor (const source of sources) {\n\t\tif (!source.location) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst relativePath = getRelativePath(source.location, basePath);\n\n\t\tif (relativePath) {\n\t\t\t// PERF: we could guess the module by matching source.location with a list of already resolved paths\n\t\t\tconst mod = extractModuleDirectory(source.location, basePath);\n\n\t\t\tif (!grouped[mod]) {\n\t\t\t\tgrouped[mod] = [];\n\t\t\t}\n\n\t\t\tgrouped[mod].push(source);\n\t\t}\n\t}\n\n\treturn grouped;\n}\n\nfunction extractModuleDirectory(filepath: string, basePath: string): string {\n\tconst relativePath = getRelativePath(filepath, basePath);\n\n\tconst [moduleDirectory] = relativePath.split(sep);\n\n\treturn moduleDirectory;\n}\n\nexport function stripFilename(path: string) {\n\tconst parsedPath = parse(path);\n\treturn normalize(parsedPath.dir);\n}\n\nexport function normalize(path: string) {\n\treturn path.replace(/\\\\/g, '/');\n}\n\nfunction ensureEndsWithSeparator(path: string) {\n\treturn path.endsWith(sep) ? path : path + sep;\n}\n\nfunction ensureStartsWithSeparator(path: string) {\n\tif (platform() === 'win32') {\n\t\treturn path;\n\t}\n\n\treturn path.startsWith('.')\n\t\t? path.replace(/^(..\\/)|(.\\/)/, '/')\n\t\t: path.startsWith('/')\n\t\t\t? path\n\t\t\t: `/${path}`;\n}\n\n/**\n * Pushes an item to a list only if the list doesn't include the item\n */\nexport function pushUnique<T>(list: T[], item: T): void {\n\tif (!list.includes(item)) {\n\t\tlist.push(item);\n\t}\n}\n\nexport function concatByKey<T extends Record<string, string[]>, K extends keyof T>(\n\tleft: T,\n\tright: T,\n\tkey: K,\n) {\n\t// Remove duplicate, if an element is in right & left, it will be only once in the returned array.\n\treturn [...new Set([...left[key], ...right[key]])];\n}\n\nexport function uniqueByKey<T extends Record<string, string[]>, K extends keyof T>(\n\tleft: T,\n\tright: T,\n\tkey: K,\n) {\n\treturn left[key].filter((item) => !right[key].includes(item));\n}\n\nexport function createObject<K extends string, T>(keys: K[], valueFn: (key: K) => T) {\n\tconst obj: Record<K, T> = {} as Record<K, T>;\n\n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Q,IAAI,OAAO,WAAW;AAC9C,UAAMC,UAAS,MAAM,WAAW;AAAA,MAC/B,GAAG;AAAA,MACH;AAAA,IACD,CAAC;AAED,WAAO;AAAA,MACN,UAAU,OAAO;AAAA,MACjB,SAASA;AAAA,IACV;AAAA,EACD,CAAC;AAED,SAAO,QAAQ,IAAI,QAAQ;AAC5B;;;AD/EO,SAAS,gBAAgB;AAC/B,SAAO,eAAe;AAAA,IACrB,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,OAAO,CAAC,SAAS,SAAS,WAAW;AACpC,YAAM,eAAe,CAAC,SAAsB;AAC3C,YAAI,QAAQ,KAAK,cAAc,QAAQ,OAAO,GAAG;AAChD,iBAAO,IAAI;AAAA,QACZ;AAAA,MACD;AAEA,cAAQ,GAAG,UAAU,YAAY;AACjC,cAAQ,GAAG,UAAU,YAAY;AAAA,IAClC;AAAA,IACA,UAAU,OAAO,KAAK,SAAS;AAC9B,YAAM,QAAQ,MAAM,SAAS,IAAI,gBAAgB;AAEjD,iBAAW,QAAQ,OAAO;AACzB,YAAI,YAAY,aAAa,KAAK,UAAU,KAAK,SAAS,SAAS;AAAA,MACpE;AAEA,aAAO,KAAK;AAAA,IACb;AAAA,EACD,CAAC;AACF;","names":["join","getCachedDocumentNodeFromSchema","getCachedDocumentNodeFromSchema","parseMapper","relative","isScalarType","Kind","Kind","name","content","Kind","isScalarType","sources","unionsDefinition","types","typePicks","relative","hash","join","result"]}
|
|
1
|
+
{"version":3,"sources":["../index.ts","../lib/codegen.ts","../utils/cache.ts","../utils/load.ts","../utils/hash.ts","../lib/context/index.ts","../lib/modules/index.ts","../lib/modules/builder.ts","../lib/modules/hashes.ts","../lib/modules/utils.ts"],"sourcesContent":["import { createPluginV1, isMatch, type WatcherFile } from '@baeta/generator-sdk';\nimport { generate } from './lib/codegen.ts';\n\nexport function graphqlPlugin() {\n\treturn createPluginV1({\n\t\tname: 'graphql',\n\t\tactionName: 'GraphQL modules',\n\t\twatch: (options, watcher, reload) => {\n\t\t\tconst handleChange = (file: WatcherFile) => {\n\t\t\t\tif (isMatch(file.relativePath, options.schemas)) {\n\t\t\t\t\treload(file);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\twatcher.on('update', handleChange);\n\t\t\twatcher.on('delete', handleChange);\n\t\t},\n\t\tgenerate: async (ctx, next) => {\n\t\t\tconst items = await generate(ctx.generatorOptions);\n\n\t\t\tfor (const item of items) {\n\t\t\t\tctx.fileManager.createAndAdd(item.filename, item.content, 'graphql');\n\t\t\t}\n\n\t\t\treturn next();\n\t\t},\n\t});\n}\n","import type { NormalizedGeneratorOptions } from '@baeta/generator-sdk';\nimport { codegen as gqlCodegen } from '@graphql-codegen/core';\nimport { normalizeConfig, normalizeInstanceOrArray } from '@graphql-codegen/plugin-helpers';\nimport * as typescriptPlugin from '@graphql-codegen/typescript';\nimport type { UnnormalizedTypeDefPointer } from '@graphql-tools/load';\nimport { createCache } from '../utils/cache.ts';\nimport { loadSchema } from '../utils/load.ts';\nimport * as contextPlugin from './context/index.ts';\nimport * as modules from './modules/index.ts';\n\nexport async function generate(options: NormalizedGeneratorOptions) {\n\tconst rootConfig = {\n\t\tschemas: normalizeInstanceOrArray(options.schemas),\n\t\tmodulesDir: options.modulesDir,\n\t\tbaseTypesPath: options.baseTypesPath,\n\t\tcontextType: options.contextType,\n\t\tmoduleDefinitionName: options.moduleDefinitionName,\n\t\tscalars: options.scalars,\n\t\tplugins: normalizeConfig(['typescript', 'context']),\n\t\tpluginMap: {\n\t\t\ttypescript: typescriptPlugin,\n\t\t\tcontext: contextPlugin,\n\t\t},\n\t};\n\n\tconst cache = createCache();\n\n\tconst schemaPointerMap: UnnormalizedTypeDefPointer = {};\n\tfor (const ptr of rootConfig.schemas) {\n\t\tif (typeof ptr === 'string') {\n\t\t\tschemaPointerMap[ptr] = {};\n\t\t} else if (typeof ptr === 'object') {\n\t\t\tObject.assign(schemaPointerMap, ptr);\n\t\t}\n\t}\n\n\tconst hash = JSON.stringify(schemaPointerMap);\n\tconst result = await cache('schema', hash, async () => {\n\t\treturn loadSchema(schemaPointerMap, options.cwd, options.loaders);\n\t});\n\n\tconst outputs = await modules.preset.buildGeneratesSection({\n\t\tbaseOutputDir: options.modulesDir,\n\t\tpresetConfig: {\n\t\t\tbaseTypesPath: rootConfig.baseTypesPath,\n\t\t\tfilename: rootConfig.moduleDefinitionName,\n\t\t\tencapsulateModuleTypes: 'none',\n\t\t\textensionsPath: options.extensions,\n\t\t\timportExtension: options.importExtension,\n\t\t},\n\t\tschema: result.outputSchema,\n\t\tschemaAst: result.outputSchemaAst,\n\t\tdocuments: [],\n\t\tpluginMap: rootConfig.pluginMap,\n\t\tplugins: rootConfig.plugins,\n\t\tconfig: {\n\t\t\tinputMaybeValue: 'T | undefined',\n\t\t\tcontextType: rootConfig.contextType,\n\t\t\tuseTypeImports: true,\n\t\t\tscalars: rootConfig.scalars,\n\t\t},\n\t});\n\n\tconst promises = outputs.map(async (output) => {\n\t\tconst result = await gqlCodegen({\n\t\t\t...output,\n\t\t\tcache,\n\t\t});\n\n\t\treturn {\n\t\t\tfilename: output.filename,\n\t\t\tcontent: result,\n\t\t};\n\t});\n\n\treturn Promise.all(promises);\n}\n","export function createCache(): <T>(\n\tnamespace: string,\n\tkey: string,\n\tfactory: () => Promise<T>,\n) => Promise<T> {\n\tconst cache = new Map<string, Promise<unknown>>();\n\n\treturn function ensure<T>(namespace: string, key: string, factory: () => Promise<T>): Promise<T> {\n\t\tconst cacheKey = `${namespace}:${key}`;\n\n\t\tconst cachedValue = cache.get(cacheKey);\n\n\t\tif (cachedValue) {\n\t\t\treturn cachedValue as Promise<T>;\n\t\t}\n\n\t\tconst value = factory();\n\t\tcache.set(cacheKey, value);\n\n\t\treturn value;\n\t};\n}\n","import { getCachedDocumentNodeFromSchema } from '@graphql-codegen/plugin-helpers';\nimport { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';\nimport {\n\tloadSchema as loadSchemaToolkit,\n\ttype UnnormalizedTypeDefPointer,\n} from '@graphql-tools/load';\nimport type { BaseLoaderOptions, Loader } from '@graphql-tools/utils';\nimport { type GraphQLSchemaExtensions, validateSchema } from 'graphql';\nimport { hashSchema } from './hash.ts';\n\nexport async function loadSchema(\n\tschemaPointerMap: UnnormalizedTypeDefPointer,\n\tcwd: string,\n\textraLoaders: Loader<BaseLoaderOptions>[] = [],\n) {\n\tconst outputSchemaAst = await loadSchemaToolkit(schemaPointerMap, {\n\t\tloaders: [new GraphQLFileLoader(), ...extraLoaders],\n\t\tcwd,\n\t\tincludeSources: true,\n\t});\n\n\tconst errors = validateSchema(outputSchemaAst);\n\n\tif (errors.length > 0) {\n\t\tconst messages = errors.map((e) => e.toString()).join('\\n\\n--------------------\\n\\n');\n\t\tconst subject = errors.length === 1 ? 'error' : 'errors';\n\t\tthrow new Error(`Invalid schema. Found ${errors.length} ${subject}:\\n\\n${messages}`);\n\t}\n\n\tif (!outputSchemaAst.extensions) {\n\t\toutputSchemaAst.extensions = {};\n\t}\n\n\t(outputSchemaAst.extensions as GraphQLSchemaExtensions).hash = hashSchema(outputSchemaAst);\n\n\treturn {\n\t\toutputSchemaAst,\n\t\toutputSchema: getCachedDocumentNodeFromSchema(outputSchemaAst),\n\t};\n}\n","import { createHash } from 'node:crypto';\nimport { getCachedDocumentNodeFromSchema } from '@graphql-codegen/plugin-helpers';\nimport { type GraphQLSchema, print } from 'graphql';\n\nexport function hashContent(content: string): string {\n\treturn createHash('sha256').update(content).digest('hex');\n}\n\nexport function hashSchema(schema: GraphQLSchema): string {\n\treturn hashContent(print(getCachedDocumentNodeFromSchema(schema)));\n}\n","import type { PluginFunction, Types } from '@graphql-codegen/plugin-helpers';\nimport { buildMapperImport, parseMapper } from '@graphql-codegen/visitor-plugin-common';\nimport type { GraphQLSchema } from 'graphql';\n\ninterface Config {\n\tcontextType: string | undefined;\n}\n\nexport const plugin: PluginFunction<Config> = async (\n\t_schema: GraphQLSchema,\n\t_documents: Types.DocumentFile[],\n\tconfig: Config,\n): Promise<Types.PluginOutput> => {\n\tconst prepend: string[] = [];\n\tconst mapper = parseMapper(config.contextType || 'any');\n\n\tif (mapper.isExternal && mapper.source) {\n\t\tconst identifier = mapper.default ? 'ContextType' : `${mapper.import} as ContextType`;\n\n\t\tconst result = buildMapperImport(\n\t\t\tmapper.source,\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tidentifier,\n\t\t\t\t\tasDefault: mapper.default,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttrue,\n\t\t);\n\n\t\tif (result) {\n\t\t\tprepend.push(result);\n\t\t}\n\t} else {\n\t\tprepend.push(`type ContextType = ${mapper.type}`);\n\t}\n\n\tprepend.push('export type { ContextType }');\n\n\treturn {\n\t\tcontent: '',\n\t\tprepend: prepend,\n\t};\n};\n\nexport default { plugin };\n","/**\n * Originally based on graphql-modules preset of graphql-code-generator\n * Source: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/graphql-modules/src/index.ts\n * Copyright (c) 2016 Dotan Simha\n * Modified by Baeta developers\n */\nimport { basename, join, relative, resolve } from '@baeta/util-path';\nimport type { Types } from '@graphql-codegen/plugin-helpers';\nimport { BaseVisitor, getConfigValue } from '@graphql-codegen/visitor-plugin-common';\nimport type { Source } from '@graphql-tools/utils';\nimport {\n\tconcatAST,\n\ttype DocumentNode,\n\tisScalarType,\n\ttype ObjectTypeDefinitionNode,\n\ttype UnionTypeDefinitionNode,\n\ttype UnionTypeExtensionNode,\n} from 'graphql';\nimport { buildModule } from './builder.ts';\nimport type { ModulesConfig } from './config.ts';\nimport {\n\tcollectObjectFieldTypesAndArguments,\n\tgroupSourcesByModule,\n\tisGraphQLPrimitive,\n\tnormalize,\n\tstripFilename,\n} from './utils.ts';\n\nexport const preset: Types.OutputPreset<ModulesConfig> = {\n\tbuildGeneratesSection: (options) => {\n\t\tconst { baseOutputDir } = options;\n\t\tconst { baseTypesPath, extensionsPath, encapsulateModuleTypes, importExtension } =\n\t\t\toptions.presetConfig;\n\n\t\tconst requireRootResolvers = getConfigValue(options?.presetConfig.requireRootResolvers, false);\n\n\t\tconst cwd = resolve(options.presetConfig.cwd || process.cwd());\n\t\tconst importTypesNamespace = options.presetConfig.importTypesNamespace || 'Types';\n\n\t\tif (!baseTypesPath) {\n\t\t\tthrow new Error(\n\t\t\t\t`Preset \"graphql-modules\" requires you to specify \"baseTypesPath\" configuration and point it to your base types file (generated by \"typescript\" plugin)!`,\n\t\t\t);\n\t\t}\n\n\t\tif (!options.schemaAst?.extensions.sources) {\n\t\t\tthrow new Error(`Preset \"graphql-modules\" requires to use GraphQL SDL`);\n\t\t}\n\n\t\tconst extensions = options.schemaAst?.extensions;\n\t\tconst sources = (extensions?.extendedSources ?? []) as Source[];\n\t\tconst sourcesByModuleMap = groupSourcesByModule(sources, baseOutputDir);\n\t\tconst modules = Object.keys(sourcesByModuleMap);\n\n\t\tconst baseVisitor = new BaseVisitor(options.config, {});\n\t\tconst { fieldTypes, fieldArguments } = collectObjectFieldTypesAndArguments(options.schemaAst);\n\n\t\t// One file with an output from all plugins\n\t\tconst baseOutput: Types.GenerateOptions = {\n\t\t\tfilename: resolve(cwd, baseOutputDir, baseTypesPath),\n\t\t\tschema: options.schema,\n\t\t\tdocuments: options.documents,\n\t\t\tplugins: [\n\t\t\t\t...options.plugins,\n\t\t\t\t{\n\t\t\t\t\t'modules-exported-scalars': {},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t'modules-exported-picks': {},\n\t\t\t\t},\n\t\t\t],\n\t\t\tpluginMap: {\n\t\t\t\t...options.pluginMap,\n\t\t\t\t'modules-exported-scalars': {\n\t\t\t\t\tplugin: (schema) => {\n\t\t\t\t\t\tconst typeMap = schema.getTypeMap();\n\n\t\t\t\t\t\treturn Object.keys(typeMap)\n\t\t\t\t\t\t\t.map((t) => {\n\t\t\t\t\t\t\t\tif (t && typeMap[t] && isScalarType(typeMap[t]) && !isGraphQLPrimitive(t)) {\n\t\t\t\t\t\t\t\t\tconst convertedName = baseVisitor.convertName(t);\n\t\t\t\t\t\t\t\t\treturn `export type ${convertedName} = Scalars[\"${t}\"];`;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t'modules-exported-picks': {\n\t\t\t\t\tplugin: () => {\n\t\t\t\t\t\tconst typePicks: string[] = [];\n\t\t\t\t\t\tconst unionPicks: string[] = [];\n\t\t\t\t\t\tconst unionResults: string[] = [];\n\t\t\t\t\t\tconst interfacePicks: string[] = [];\n\t\t\t\t\t\tconst interfaceResults: string[] = [];\n\n\t\t\t\t\t\tconst unionTypesMap: Record<string, string[] | undefined> = {};\n\t\t\t\t\t\tconst interfacesTypesMap: Record<string, string[] | undefined> = {};\n\n\t\t\t\t\t\tfor (const moduleName of modules) {\n\t\t\t\t\t\t\tconst sources = sourcesByModuleMap[moduleName];\n\t\t\t\t\t\t\tconst documents = sources.map((source) => source.document) as DocumentNode[];\n\t\t\t\t\t\t\tconst moduleDocument = concatAST(documents);\n\n\t\t\t\t\t\t\tconst types = moduleDocument.definitions.filter(\n\t\t\t\t\t\t\t\t(def) => def.kind === 'ObjectTypeDefinition',\n\t\t\t\t\t\t\t) as ObjectTypeDefinitionNode[];\n\n\t\t\t\t\t\t\tconst unionsDefinition = moduleDocument.definitions.filter(\n\t\t\t\t\t\t\t\t(def) => def.kind === 'UnionTypeDefinition',\n\t\t\t\t\t\t\t) as UnionTypeDefinitionNode[];\n\n\t\t\t\t\t\t\tconst unionsExtensions = moduleDocument.definitions.filter(\n\t\t\t\t\t\t\t\t(def) => def.kind === 'UnionTypeExtension',\n\t\t\t\t\t\t\t) as UnionTypeExtensionNode[];\n\n\t\t\t\t\t\t\tconst unions = [...unionsDefinition, ...unionsExtensions];\n\n\t\t\t\t\t\t\tfor (const type of types) {\n\t\t\t\t\t\t\t\tconst name = type.name.value;\n\n\t\t\t\t\t\t\t\tfor (const interfaceNode of type.interfaces ?? []) {\n\t\t\t\t\t\t\t\t\tconst interfaceName = interfaceNode.name.value;\n\n\t\t\t\t\t\t\t\t\tif (interfacesTypesMap[interfaceName] == null) {\n\t\t\t\t\t\t\t\t\t\tinterfacesTypesMap[interfaceName] = [];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tinterfacesTypesMap[interfaceName]?.push(name);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (name === 'Query' || name === 'Mutation' || name === 'Subscription') {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst fields = type.fields ?? [];\n\n\t\t\t\t\t\t\t\tif (fields.length === 0) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst fieldNames = fields.map((f) => `\"${f.name.value}\"`).join(' | ');\n\n\t\t\t\t\t\t\t\ttypePicks.push(` ${name}: ${fieldNames};`);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (const union of unions) {\n\t\t\t\t\t\t\t\tconst types = union.types?.map((t) => t.name.value) ?? [];\n\n\t\t\t\t\t\t\t\tif (unionTypesMap[union.name.value] == null) {\n\t\t\t\t\t\t\t\t\tunionTypesMap[union.name.value] = [];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tunionTypesMap[union.name.value]?.push(...types);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const unionName in unionTypesMap) {\n\t\t\t\t\t\t\tconst types = unionTypesMap[unionName];\n\n\t\t\t\t\t\t\tif (types == null || types.length === 0) {\n\t\t\t\t\t\t\t\tunionPicks.push(` ${unionName}: never;`);\n\t\t\t\t\t\t\t\tunionResults.push(` ${unionName}: null;`);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst typePicks = types.map((t) => {\n\t\t\t\t\t\t\t\tconst normalizedTypeName = baseVisitor.convertName(t, {\n\t\t\t\t\t\t\t\t\tuseTypesSuffix: true,\n\t\t\t\t\t\t\t\t\tuseTypesPrefix: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn `Pick<${normalizedTypeName}, DefinedFieldsWithoutExtensions[\"${t}\"] | \"__typename\">`;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst resultPicks = types.map((t) => `\"${t}\"`);\n\n\t\t\t\t\t\t\tunionPicks.push(` ${unionName}: ${typePicks.join(' | ')};`);\n\t\t\t\t\t\t\tunionResults.push(` ${unionName}: ${resultPicks.join(' | ')} | null;`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const interfaceName in interfacesTypesMap) {\n\t\t\t\t\t\t\tconst types = interfacesTypesMap[interfaceName];\n\n\t\t\t\t\t\t\tif (types == null || types.length === 0) {\n\t\t\t\t\t\t\t\tinterfacePicks.push(` ${interfaceName}: never;`);\n\t\t\t\t\t\t\t\tinterfaceResults.push(` ${interfaceName}: null;`);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst typePicks = types.map((t) => {\n\t\t\t\t\t\t\t\tconst normalizedTypeName = baseVisitor.convertName(t, {\n\t\t\t\t\t\t\t\t\tuseTypesSuffix: true,\n\t\t\t\t\t\t\t\t\tuseTypesPrefix: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn `Pick<${normalizedTypeName}, DefinedFieldsWithoutExtensions[\"${t}\"] | \"__typename\">`;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst resultPicks = types.map((t) => `\"${t}\"`);\n\n\t\t\t\t\t\t\tinterfacePicks.push(` ${interfaceName}: ${typePicks.join(' | ')};`);\n\t\t\t\t\t\t\tinterfaceResults.push(` ${interfaceName}: ${resultPicks.join(' | ')} | null;`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst fieldsDefinition = `export type DefinedFieldsWithoutExtensions = {\\n${typePicks.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst unionsDefinition = `export type DefinedUnionsWithoutExtensions = {\\n${unionPicks.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst unionsResultsDefinition = `export type DefinedUnionsResults = {\\n${unionResults.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst interfacesDefinition = `export type DefinedInterfacesWithoutExtensions = {\\n${interfacePicks.join('\\n')}\\n};`;\n\t\t\t\t\t\tconst interfacesResultsDefinition = `export type DefinedInterfacesResults = {\\n${interfaceResults.join(\n\t\t\t\t\t\t\t'\\n',\n\t\t\t\t\t\t)}\\n};`;\n\n\t\t\t\t\t\tconst result = [\n\t\t\t\t\t\t\tfieldsDefinition,\n\t\t\t\t\t\t\tunionsDefinition,\n\t\t\t\t\t\t\tunionsResultsDefinition,\n\t\t\t\t\t\t\tinterfacesDefinition,\n\t\t\t\t\t\t\tinterfacesResultsDefinition,\n\t\t\t\t\t\t].join('\\n\\n');\n\n\t\t\t\t\t\treturn `\\n${result}\\n`;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tconfig: {\n\t\t\t\t...options.config,\n\t\t\t\tenumsAsTypes: true,\n\t\t\t},\n\t\t\tschemaAst: options.schemaAst,\n\t\t};\n\n\t\tconst baseTypesFilename =\n\t\t\tbasename(baseTypesPath).replace(/\\.(js|ts|d.ts)$/, '') + (importExtension || '');\n\t\tconst baseTypesDir = stripFilename(baseOutput.filename);\n\n\t\t// One file per each module\n\t\tconst outputs: Types.GenerateOptions[] = modules.map((moduleName) => {\n\t\t\tconst filename = resolve(cwd, baseOutputDir, moduleName, options.presetConfig.filename);\n\t\t\tconst dirpath = stripFilename(filename);\n\t\t\tconst relativePath = relative(dirpath, baseTypesDir);\n\t\t\tconst importPath =\n\t\t\t\toptions.presetConfig.importBaseTypesFrom ||\n\t\t\t\tnormalize(join(relativePath, baseTypesFilename));\n\t\t\tconst sources = sourcesByModuleMap[moduleName];\n\n\t\t\tconst documents = sources.map((source) => source.document) as DocumentNode[];\n\n\t\t\tconst moduleDocument = concatAST(documents);\n\n\t\t\tconst shouldDeclare = filename.endsWith('.d.ts');\n\n\t\t\treturn {\n\t\t\t\tfilename,\n\t\t\t\tschema: options.schema,\n\t\t\t\tdocuments: [],\n\t\t\t\tplugins: [\n\t\t\t\t\t...options.plugins.filter((p) => typeof p === 'object' && !!p.add),\n\t\t\t\t\t{\n\t\t\t\t\t\t'graphql-modules-plugin': {},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tpluginMap: {\n\t\t\t\t\t...options.pluginMap,\n\t\t\t\t\t'graphql-modules-plugin': {\n\t\t\t\t\t\tplugin: (schema) =>\n\t\t\t\t\t\t\tbuildModule(moduleName, moduleDocument, {\n\t\t\t\t\t\t\t\timportNamespace: importTypesNamespace,\n\t\t\t\t\t\t\t\timportPath,\n\t\t\t\t\t\t\t\tencapsulate: encapsulateModuleTypes || 'namespace',\n\t\t\t\t\t\t\t\trequireRootResolvers,\n\t\t\t\t\t\t\t\tshouldDeclare,\n\t\t\t\t\t\t\t\tschema,\n\t\t\t\t\t\t\t\tbaseVisitor,\n\t\t\t\t\t\t\t\tuseGraphQLModules: false,\n\t\t\t\t\t\t\t\tfieldTypes,\n\t\t\t\t\t\t\t\tfieldArguments,\n\t\t\t\t\t\t\t\textensionsPath,\n\t\t\t\t\t\t\t\trootTypes: [\n\t\t\t\t\t\t\t\t\tschema.getQueryType()?.name || '',\n\t\t\t\t\t\t\t\t\tschema.getMutationType()?.name || '',\n\t\t\t\t\t\t\t\t\tschema.getSubscriptionType()?.name || '',\n\t\t\t\t\t\t\t\t].filter(Boolean),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tconfig: options.config,\n\t\t\t\tschemaAst: options.schemaAst,\n\t\t\t};\n\t\t});\n\n\t\treturn [baseOutput].concat(outputs);\n\t},\n};\n\nexport default preset;\n","/**\n * Originally based on graphql-modules preset of graphql-code-generator\n * Source: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/graphql-modules/src/builder.ts\n * Copyright (c) 2016 Dotan Simha\n * Modified by Baeta developers\n */\nimport type { BaseVisitor } from '@graphql-codegen/visitor-plugin-common';\nimport { pascalCase } from 'change-case-all';\nimport {\n\ttype DocumentNode,\n\ttype EnumTypeDefinitionNode,\n\ttype EnumTypeExtensionNode,\n\ttype GraphQLSchema,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InputObjectTypeExtensionNode,\n\ttype InterfaceTypeDefinitionNode,\n\ttype InterfaceTypeExtensionNode,\n\tisInterfaceType,\n\tisScalarType,\n\tisUnionType,\n\tKind,\n\ttype ObjectTypeDefinitionNode,\n\ttype ObjectTypeExtensionNode,\n\ttype TypeDefinitionNode,\n\ttype TypeExtensionNode,\n\ttype UnionTypeDefinitionNode,\n\tvisit,\n} from 'graphql';\nimport type { ModulesConfig } from './config.ts';\nimport { getObjectTypeHash, type TypeHash } from './hashes.ts';\nimport {\n\tbuildBlock,\n\tcollectUsedTypes,\n\tconcatByKey,\n\tcreateObject,\n\tindent,\n\tpushUnique,\n\tunique,\n\tuniqueByKey,\n\twithQuotes,\n} from './utils.ts';\n\ntype RegistryKeys = 'objects' | 'inputs' | 'interfaces' | 'scalars' | 'unions' | 'enums';\ntype Registry = Record<RegistryKeys, string[]>;\nconst registryKeys: RegistryKeys[] = [\n\t'objects',\n\t'inputs',\n\t'interfaces',\n\t'scalars',\n\t'unions',\n\t'enums',\n];\n\nexport function buildModule(\n\tname: string,\n\tdoc: DocumentNode,\n\t{\n\t\timportNamespace,\n\t\timportPath,\n\t\tencapsulate,\n\t\tshouldDeclare,\n\t\trootTypes,\n\t\tschema,\n\t\tbaseVisitor,\n\t\tfieldTypes,\n\t\tfieldArguments,\n\t\textensionsPath,\n\t}: {\n\t\timportNamespace: string;\n\t\timportPath: string;\n\t\tencapsulate: ModulesConfig['encapsulateModuleTypes'];\n\t\trequireRootResolvers: ModulesConfig['requireRootResolvers'];\n\t\tshouldDeclare: boolean;\n\t\trootTypes: string[];\n\t\tbaseVisitor: BaseVisitor;\n\t\tschema?: GraphQLSchema;\n\t\tuseGraphQLModules: boolean;\n\t\tfieldTypes: Record<string, Record<string, string>>;\n\t\tfieldArguments: Record<string, Record<string, boolean>>;\n\t\textensionsPath?: string;\n\t},\n): string {\n\tconst picks: Record<RegistryKeys, Record<string, string[]>> = createObject(\n\t\tregistryKeys,\n\t\t() => ({}),\n\t);\n\tconst defined: Registry = createObject(registryKeys, () => []);\n\tconst extended: Registry = createObject(registryKeys, () => []);\n\n\tconst hashes: Record<string, TypeHash> = {};\n\n\t// List of types used in objects, fields, arguments etc\n\tconst usedTypes = collectUsedTypes(doc);\n\n\tvisit(doc, {\n\t\tObjectTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tObjectTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tInputObjectTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tInputObjectTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tInterfaceTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tInterfaceTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tScalarTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tUnionTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tUnionTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t\tEnumTypeDefinition(node) {\n\t\t\tcollectTypeDefinition(node);\n\t\t},\n\t\tEnumTypeExtension(node) {\n\t\t\tcollectTypeExtension(node);\n\t\t},\n\t});\n\n\t// Defined and Extended types\n\tconst visited: Registry = createObject(registryKeys, (key) =>\n\t\tconcatByKey(defined, extended, key),\n\t);\n\n\t// Types that are not defined or extended in a module, they come from other modules\n\tconst external: Registry = createObject(registryKeys, (key) =>\n\t\tuniqueByKey(extended, defined, key),\n\t);\n\n\t//\n\t//\n\t//\n\t// Prints\n\t//\n\t//\n\t//\n\n\t// An actual output\n\tconst imports = [\n\t\t`import * as ${importNamespace} from \"${importPath}\";`,\n\t\t'import type { DocumentNode } from \"graphql\";',\n\t\t'import * as Baeta from \"@baeta/core/sdk\";',\n\t];\n\n\tif (extensionsPath) {\n\t\timports.push(`import baetaExtensions from \"${extensionsPath}\";`);\n\t}\n\n\timports.push('\\n');\n\n\tlet content = [\n\t\tprintDefinedFields(),\n\t\tprintDefinedEnumValues(),\n\t\tprintDefinedInputFields(),\n\t\tprintSchemaTypes(usedTypes),\n\t\tprintMetadata(),\n\t]\n\t\t.filter(Boolean)\n\t\t.join('\\n\\n');\n\n\tconst moduleNamespace = baseVisitor.convertName(name, {\n\t\tsuffix: 'Module',\n\t\tuseTypesPrefix: false,\n\t\tuseTypesSuffix: false,\n\t});\n\n\tif (encapsulate === 'namespace') {\n\t\tcontent = `${shouldDeclare ? 'declare' : 'export'} namespace ${baseVisitor.convertName(name, {\n\t\t\tsuffix: 'Module',\n\t\t\tuseTypesPrefix: false,\n\t\t\tuseTypesSuffix: false,\n\t\t})} {\\n${shouldDeclare ? `${indent(2)(imports.join('\\n'))}\\n` : ''}${indent(2)(content)}\\n}`;\n\t}\n\n\treturn [...(shouldDeclare ? [] : imports), content, printFactoryMethod()]\n\t\t.filter(Boolean)\n\t\t.join('\\n');\n\n\tfunction printMetadata() {\n\t\treturn `export namespace ModuleMetadata {\n export const id = '${name}';\n export const dirname = './${name}';\n export const hashes = ${JSON.stringify(hashes)};\n export const typedef = ${JSON.stringify(doc)} as unknown as DocumentNode;\n ${printBaetaManager()}\n}`;\n\t}\n\n\t/**\n\t * A dictionary of fields to pick from an object\n\t */\n\tfunction printDefinedFields() {\n\t\treturn buildBlock({\n\t\t\tname: 'interface DefinedFields',\n\t\t\tlines: [...visited.objects, ...visited.interfaces].map(\n\t\t\t\t(typeName) =>\n\t\t\t\t\t`${typeName}: ${printPicks(typeName, {\n\t\t\t\t\t\t...picks.objects,\n\t\t\t\t\t\t...picks.interfaces,\n\t\t\t\t\t})};`,\n\t\t\t),\n\t\t});\n\t}\n\n\tfunction printFactoryMethod() {\n\t\tconst name = moduleNamespace.slice(0, moduleNamespace.length - 6);\n\t\tconst createModuleFn = `create${name}Module`;\n\t\tconst getModuleFn = `get${name}Module`;\n\t\tconst extensionsArg = extensionsPath ? ', baetaExtensions' : '';\n\n\t\treturn `\nexport const ${createModuleFn} = () => Baeta.createModuleManager(ModuleMetadata${extensionsArg});\nexport const ${getModuleFn} = Baeta.createSingletonModule(${createModuleFn});\n`;\n\t}\n\n\t/**\n\t * Baeta manager\n\t */\n\n\tfunction printObjectFieldResolverBuilder(typeName: string, field: string) {\n\t\tconst parentType = getParentType(typeName);\n\t\tconst resultType = getResultType(typeName, field);\n\t\tconst argumentsType = getArgsType(typeName, field);\n\t\tconst contextType = getContextType();\n\t\treturn `${field}: module.createResolverBuilder<${resultType}, ${parentType}, ${contextType}, ${argumentsType}>(\"${typeName}\", \"${field}\"),`;\n\t}\n\n\tfunction printObjectResolverBuilder(typeName: string, objects: Record<string, string[]>) {\n\t\tconst fields =\n\t\t\tobjects[typeName]\n\t\t\t\t?.filter(unique)\n\t\t\t\t.map((field) => printObjectFieldResolverBuilder(typeName, field)) ?? [];\n\n\t\tif (fields.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst parentType = getParentType(typeName);\n\t\tconst contextType = getContextType();\n\n\t\tconst addons = [`...module.createTypeMethods<${parentType}, ${contextType}>(\"${typeName}\"),`];\n\t\tconst contentBody = [...addons, ...fields].map(indent(2)).join('\\n');\n\t\tconst content = `{\\n${contentBody}\\n}`;\n\t\treturn `${typeName}: ${content},`;\n\t}\n\n\tfunction printSubscriptionFieldBuilder(field: string) {\n\t\tconst parentType = getParentType('Subscription');\n\t\tconst resultType = getResultType('Subscription', field);\n\t\tconst argumentsType = getArgsType('Subscription', field);\n\t\tconst contextType = getContextType();\n\t\treturn `${field}: module.createSubscriptionBuilder<${resultType}, ${parentType}, ${contextType}, ${argumentsType}>(\"${field}\"),`;\n\t}\n\n\tfunction printSubscriptionObjectBuilder() {\n\t\tconst subscriptions = picks.objects.Subscription?.filter(unique) ?? [];\n\n\t\tif (subscriptions.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fields = subscriptions.map((subscription) => printSubscriptionFieldBuilder(subscription));\n\n\t\tconst parentType = getParentType('Subscription');\n\t\tconst contextType = getContextType();\n\t\tconst addons = [`...module.createSubscriptionMethods<${parentType}, ${contextType}>(),`];\n\t\tconst contentBody = [...addons, ...fields].map(indent(2)).join('\\n');\n\n\t\tconst content = `{\\n${contentBody}\\n}`;\n\t\treturn `Subscription: ${content},`;\n\t}\n\n\tfunction printScalarBuilder() {\n\t\tconst scalars = visited.scalars;\n\t\tif (scalars.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fields = scalars.map((scalar) => `${scalar}: module.createScalarBuilder(\"${scalar}\"),`);\n\t\tconst content = fields.map(indent(2)).join('\\n');\n\t\treturn `Scalar: {\\n${content}\\n},`;\n\t}\n\n\tfunction printTypenameResolverBuilder(\n\t\tname: string,\n\t\tresultNamespace: string,\n\t\tvalueNamespace: string,\n\t) {\n\t\tconst resultType = `${importNamespace}.${resultNamespace}[\"${name}\"]`;\n\t\tconst valueType = `${importNamespace}.${valueNamespace}[\"${name}\"]`;\n\t\tconst contextType = getContextType();\n\t\tconst resolver = `$resolveType: module.createResolveType<${resultType}, ${valueType}, ${contextType}>(\"${name}\"),`;\n\t\treturn `${name}: {\\n${indent(2)(resolver)}\\n},`;\n\t}\n\n\tfunction printInterfaceBuilder() {\n\t\tconst interfaces = defined.interfaces;\n\n\t\tif (interfaces.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn interfaces\n\t\t\t.map((interfaceName) =>\n\t\t\t\tprintTypenameResolverBuilder(\n\t\t\t\t\tinterfaceName,\n\t\t\t\t\t'DefinedInterfacesResults',\n\t\t\t\t\t'DefinedInterfacesWithoutExtensions',\n\t\t\t\t),\n\t\t\t)\n\t\t\t.join('\\n');\n\t}\n\n\tfunction printUnionBuilder() {\n\t\tconst unions = defined.unions;\n\n\t\tif (unions.length === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn unions\n\t\t\t.map((unionName) =>\n\t\t\t\tprintTypenameResolverBuilder(\n\t\t\t\t\tunionName,\n\t\t\t\t\t'DefinedUnionsResults',\n\t\t\t\t\t'DefinedUnionsWithoutExtensions',\n\t\t\t\t),\n\t\t\t)\n\t\t\t.join('\\n');\n\t}\n\n\tfunction printBaetaManager() {\n\t\tconst objects = visited.objects\n\t\t\t.filter((type) => type !== 'Subscription')\n\t\t\t.map((typeName) => printObjectResolverBuilder(typeName, picks.objects))\n\t\t\t.filter(Boolean);\n\n\t\tconst contextType = getContextType();\n\t\tconst addons = [`...module.createModuleMethods<${contextType}>(),`];\n\n\t\tconst bodyFields = [\n\t\t\t...addons,\n\t\t\t...objects,\n\t\t\tprintScalarBuilder(),\n\t\t\tprintSubscriptionObjectBuilder(),\n\t\t\tprintInterfaceBuilder(),\n\t\t\tprintUnionBuilder(),\n\t\t];\n\n\t\tconst body = bodyFields.filter(Boolean).map(indent(6)).join('\\n');\n\t\tconst content = `{\\n${body}\\n }`;\n\n\t\treturn `\n export function createManager(module: Baeta.ModuleBuilder) {\n return ${content};\n }`;\n\t}\n\n\t/**\n\t * A dictionary of values to pick from an enum\n\t */\n\tfunction printDefinedEnumValues() {\n\t\treturn buildBlock({\n\t\t\tname: 'interface DefinedEnumValues',\n\t\t\tlines: visited.enums.map((typeName) => `${typeName}: ${printPicks(typeName, picks.enums)};`),\n\t\t});\n\t}\n\n\tfunction encapsulateTypeName(typeName: string): string {\n\t\tif (encapsulate === 'prefix') {\n\t\t\treturn `${pascalCase(name)}_${typeName}`;\n\t\t}\n\n\t\treturn typeName;\n\t}\n\n\t/**\n\t * A dictionary of fields to pick from an input\n\t */\n\tfunction printDefinedInputFields() {\n\t\treturn buildBlock({\n\t\t\tname: 'interface DefinedInputFields',\n\t\t\tlines: visited.inputs.map(\n\t\t\t\t(typeName) => `${typeName}: ${printPicks(typeName, picks.inputs)};`,\n\t\t\t),\n\t\t});\n\t}\n\n\t/**\n\t * Prints signatures of schema types with picks\n\t */\n\tfunction printSchemaTypes(types: string[]) {\n\t\treturn types\n\t\t\t.filter((type) => !visited.scalars.includes(type))\n\t\t\t.map(printExportType)\n\t\t\t.join('\\n');\n\t}\n\n\tfunction printPicks(typeName: string, records: Record<string, string[]>): string {\n\t\treturn records[typeName].filter(unique).map(withQuotes).join(' | ');\n\t}\n\n\tfunction printTypeBody(typeName: string): string {\n\t\tconst normalizedTypeName = baseVisitor.convertName(typeName, {\n\t\t\tuseTypesSuffix: true,\n\t\t\tuseTypesPrefix: true,\n\t\t});\n\n\t\tconst coreType = `${importNamespace}.${normalizedTypeName}`;\n\n\t\tif (external.enums.includes(typeName) || external.objects.includes(typeName)) {\n\t\t\tif (schema && isScalarType(schema.getType(typeName))) {\n\t\t\t\treturn `${importNamespace}.Scalars['${typeName}']`;\n\t\t\t}\n\n\t\t\treturn `Pick<${coreType}, ${importNamespace}.DefinedFieldsWithoutExtensions[\"${typeName}\"]>`;\n\t\t}\n\n\t\tif (external.unions.includes(typeName)) {\n\t\t\treturn `${importNamespace}.DefinedUnionsWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (external.interfaces.includes(typeName)) {\n\t\t\treturn `Pick<${coreType}, ${importNamespace}.DefinedFieldsWithoutExtensions[\"${typeName}\"]>`;\n\t\t}\n\n\t\tif (defined.enums.includes(typeName) && picks.enums[typeName]) {\n\t\t\treturn `DefinedEnumValues['${typeName}']`;\n\t\t}\n\n\t\tif (defined.unions.includes(typeName) && picks.unions[typeName]) {\n\t\t\treturn `${importNamespace}.DefinedUnionsWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (defined.objects.includes(typeName) && picks.objects[typeName]) {\n\t\t\treturn `Pick<${coreType}, DefinedFields['${typeName}']>`;\n\t\t}\n\n\t\tif (defined.interfaces.includes(typeName) && picks.interfaces[typeName]) {\n\t\t\treturn `${importNamespace}.DefinedInterfacesWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (defined.inputs.includes(typeName) && picks.inputs[typeName]) {\n\t\t\treturn `Pick<${coreType}, DefinedInputFields['${typeName}']>`;\n\t\t}\n\n\t\tif (isScalarType(schema?.getType(typeName))) {\n\t\t\treturn coreType;\n\t\t}\n\n\t\tif (isInterfaceType(schema?.getType(typeName))) {\n\t\t\treturn `${importNamespace}.DefinedInterfacesWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\tif (isUnionType(schema?.getType(typeName))) {\n\t\t\treturn `${importNamespace}.DefinedUnionsWithoutExtensions[\"${typeName}\"]`;\n\t\t}\n\n\t\treturn `Pick<${coreType}, ${importNamespace}.DefinedFieldsWithoutExtensions[\"${typeName}\"]>`;\n\t}\n\n\tfunction printExportType(typeName: string): string {\n\t\treturn `export type ${encapsulateTypeName(typeName)} = ${printTypeBody(typeName)};`;\n\t}\n\n\t//\n\t//\n\t//\n\t// Utils\n\t//\n\t//\n\t//\n\n\tfunction collectFields(\n\t\tnode:\n\t\t\t| ObjectTypeDefinitionNode\n\t\t\t| ObjectTypeExtensionNode\n\t\t\t| InterfaceTypeDefinitionNode\n\t\t\t| InterfaceTypeExtensionNode\n\t\t\t| InputObjectTypeDefinitionNode\n\t\t\t| InputObjectTypeExtensionNode,\n\t\tpicksObj: Record<string, string[]>,\n\t) {\n\t\tconst name = node.name.value;\n\n\t\tif (node.fields) {\n\t\t\tif (!picksObj[name]) {\n\t\t\t\tpicksObj[name] = [];\n\t\t\t}\n\n\t\t\tfor (const field of node.fields) {\n\t\t\t\tpicksObj[name].push(field.name.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectValuesFromEnum(node: EnumTypeDefinitionNode | EnumTypeExtensionNode) {\n\t\tconst name = node.name.value;\n\n\t\tif (node.values) {\n\t\t\tif (!picks.enums[name]) {\n\t\t\t\tpicks.enums[name] = [];\n\t\t\t}\n\n\t\t\tfor (const field of node.values) {\n\t\t\t\tpicks.enums[name].push(field.name.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectUnionTypes(node: UnionTypeDefinitionNode) {\n\t\tconst name = node.name.value;\n\n\t\tif (node.types) {\n\t\t\tif (!picks.unions[name]) {\n\t\t\t\tpicks.unions[name] = [];\n\t\t\t}\n\n\t\t\tfor (const type of node.types) {\n\t\t\t\tpicks.unions[name].push(type.name.value);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectTypeDefinition(node: TypeDefinitionNode) {\n\t\tconst name = node.name.value;\n\n\t\tswitch (node.kind) {\n\t\t\tcase Kind.OBJECT_TYPE_DEFINITION: {\n\t\t\t\tdefined.objects.push(name);\n\t\t\t\tcollectFields(node, picks.objects);\n\t\t\t\thashes[name] = getObjectTypeHash(node);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.ENUM_TYPE_DEFINITION: {\n\t\t\t\tdefined.enums.push(name);\n\t\t\t\tcollectValuesFromEnum(node);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INPUT_OBJECT_TYPE_DEFINITION: {\n\t\t\t\tdefined.inputs.push(name);\n\t\t\t\tcollectFields(node, picks.inputs);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.SCALAR_TYPE_DEFINITION: {\n\t\t\t\tdefined.scalars.push(name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INTERFACE_TYPE_DEFINITION: {\n\t\t\t\tdefined.interfaces.push(name);\n\t\t\t\tcollectFields(node, picks.interfaces);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.UNION_TYPE_DEFINITION: {\n\t\t\t\tdefined.unions.push(name);\n\t\t\t\tcollectUnionTypes(node);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction collectTypeExtension(node: TypeExtensionNode) {\n\t\tconst name = node.name.value;\n\n\t\tswitch (node.kind) {\n\t\t\tcase Kind.OBJECT_TYPE_EXTENSION: {\n\t\t\t\tcollectFields(node, picks.objects);\n\t\t\t\thashes[name] = getObjectTypeHash(node);\n\n\t\t\t\t// Do not include root types as extensions\n\t\t\t\t// so we can use them in DefinedFields\n\t\t\t\tif (rootTypes.includes(name)) {\n\t\t\t\t\tpushUnique(defined.objects, name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpushUnique(extended.objects, name);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.ENUM_TYPE_EXTENSION: {\n\t\t\t\tcollectValuesFromEnum(node);\n\t\t\t\tpushUnique(extended.enums, name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INPUT_OBJECT_TYPE_EXTENSION: {\n\t\t\t\tcollectFields(node, picks.inputs);\n\t\t\t\tpushUnique(extended.inputs, name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.INTERFACE_TYPE_EXTENSION: {\n\t\t\t\tcollectFields(node, picks.interfaces);\n\t\t\t\tpushUnique(extended.interfaces, name);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Kind.UNION_TYPE_EXTENSION: {\n\t\t\t\tpushUnique(extended.unions, name);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction getParentType(type: string) {\n\t\tif (['Query', 'Mutation', 'Subscription'].includes(type)) {\n\t\t\treturn '{ }';\n\t\t}\n\t\treturn type;\n\t}\n\n\tfunction getResultType(type: string, field: string) {\n\t\treturn fieldTypes?.[type]?.[field] || '{ }';\n\t}\n\n\tfunction getArgsType(type: string, field: string) {\n\t\tconst hasArgs = fieldArguments?.[type]?.[field] ?? false;\n\t\tif (!hasArgs) {\n\t\t\treturn '{ }';\n\t\t}\n\t\tconst fieldUpper = field[0].toUpperCase() + field.slice(1);\n\t\treturn `Types.${type}${fieldUpper}Args`;\n\t}\n\n\tfunction getContextType() {\n\t\treturn 'Types.ContextType';\n\t}\n}\n","import {\n\ttype FieldDefinitionNode,\n\tKind,\n\ttype ObjectTypeDefinitionNode,\n\ttype ObjectTypeExtensionNode,\n\ttype TypeNode,\n} from 'graphql';\nimport hash from 'murmurhash';\n\nexport type TypeHash = {\n\thash: string;\n\tfieldsHashes: Record<string, string>;\n};\n\nexport function getObjectTypeHash(\n\tnode: ObjectTypeDefinitionNode | ObjectTypeExtensionNode,\n): TypeHash {\n\tconst fieldNames = buildFieldsNames(node.fields);\n\tconst typeFields = fieldNames\n\t\t.map(([fieldName, fieldType]) => `${fieldName}:${fieldType}`)\n\t\t.join(',');\n\n\tconst fieldMap: Record<string, string> = {};\n\n\tfor (const [fieldName, fieldType] of fieldNames) {\n\t\tfieldMap[fieldName] = hash.v3(fieldType).toString(36);\n\t}\n\n\treturn {\n\t\thash: hash.v3(typeFields).toString(36),\n\t\tfieldsHashes: fieldMap,\n\t};\n}\n\nfunction buildFieldsNames(fields: readonly FieldDefinitionNode[] = []) {\n\tif (fields.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst fieldsNames: Array<[string, string]> = [];\n\n\tfor (const field of fields) {\n\t\tconst fieldName = field.name.value;\n\t\tconst fieldType = buildTypeName(field.type);\n\t\tfieldsNames.push([fieldName, fieldType]);\n\t}\n\n\treturn fieldsNames.sort(([a], [b]) => a.localeCompare(b));\n}\n\nfunction buildTypeName(node: TypeNode): string {\n\tif (node.kind === Kind.NAMED_TYPE) {\n\t\treturn node.name.value;\n\t}\n\n\tif (node.kind === Kind.LIST_TYPE) {\n\t\treturn `[${buildTypeName(node.type)}]`;\n\t}\n\n\tif (node.kind === Kind.NON_NULL_TYPE) {\n\t\treturn `${buildTypeName(node.type)}!`;\n\t}\n\n\treturn '';\n}\n","/**\n * Originally based on graphql-modules preset of graphql-code-generator\n * Source: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/presets/graphql-modules/src/utils.ts\n * Copyright (c) 2016 Dotan Simha\n * Modified by Baeta developers\n */\nimport { platform } from 'node:os';\nimport { getBaseType } from '@graphql-codegen/plugin-helpers';\nimport { DEFAULT_SCALARS, wrapTypeWithModifiers } from '@graphql-codegen/visitor-plugin-common';\nimport type { Source } from '@graphql-tools/utils';\nimport {\n\ttype DefinitionNode,\n\ttype DocumentNode,\n\ttype FieldDefinitionNode,\n\ttype GraphQLFieldMap,\n\ttype GraphQLObjectType,\n\ttype GraphQLSchema,\n\ttype InputValueDefinitionNode,\n\tKind,\n\ttype NamedTypeNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype TypeNode,\n} from 'graphql';\nimport parse from 'parse-filepath';\n\nconst sep = '/';\n\n/**\n * Searches every node to collect used types\n */\nexport function collectUsedTypes(doc: DocumentNode): string[] {\n\tconst used: string[] = [];\n\n\tfor (const definition of doc.definitions) {\n\t\tfindRelated(definition);\n\t}\n\n\tfunction markAsUsed(type: string) {\n\t\tpushUnique(used, type);\n\t}\n\n\tfunction findRelated(\n\t\tnode: DefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | NamedTypeNode,\n\t) {\n\t\tif (node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_EXTENSION) {\n\t\t\t// Object\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.fields) {\n\t\t\t\tfor (const field of node.fields) {\n\t\t\t\t\tfindRelated(field);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node.interfaces) {\n\t\t\t\tfor (const _interface of node.interfaces) {\n\t\t\t\t\tfindRelated(_interface);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Input\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.fields) {\n\t\t\t\tfor (const field of node.fields) {\n\t\t\t\t\tfindRelated(field);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.INTERFACE_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Interface\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.fields) {\n\t\t\t\tfor (const field of node.fields) {\n\t\t\t\t\tfindRelated(field);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node.interfaces) {\n\t\t\t\tfor (const _interface of node.interfaces) {\n\t\t\t\t\tfindRelated(_interface);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.UNION_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.UNION_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Union\n\t\t\tmarkAsUsed(node.name.value);\n\n\t\t\tif (node.types) {\n\t\t\t\tfor (const type of node.types) {\n\t\t\t\t\tfindRelated(type);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_EXTENSION) {\n\t\t\t// Enum\n\t\t\tmarkAsUsed(node.name.value);\n\t\t} else if (\n\t\t\tnode.kind === Kind.SCALAR_TYPE_DEFINITION ||\n\t\t\tnode.kind === Kind.SCALAR_TYPE_EXTENSION\n\t\t) {\n\t\t\t// Scalar\n\t\t\tif (!isGraphQLPrimitive(node.name.value)) {\n\t\t\t\tmarkAsUsed(node.name.value);\n\t\t\t}\n\t\t} else if (node.kind === Kind.INPUT_VALUE_DEFINITION) {\n\t\t\t// Argument\n\t\t\tfindRelated(resolveTypeNode(node.type));\n\t\t} else if (node.kind === Kind.FIELD_DEFINITION) {\n\t\t\t// Field\n\t\t\tfindRelated(resolveTypeNode(node.type));\n\n\t\t\tif (node.arguments) {\n\t\t\t\tfor (const argument of node.arguments) {\n\t\t\t\t\tfindRelated(argument);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tnode.kind === Kind.NAMED_TYPE &&\n\t\t\t// Named type\n\t\t\t!isGraphQLPrimitive(node.name.value)\n\t\t) {\n\t\t\tmarkAsUsed(node.name.value);\n\t\t}\n\t}\n\n\treturn used;\n}\n\nfunction collectObjectFieldType(\n\tnode: ObjectTypeDefinitionNode,\n\tfieldDefinition: FieldDefinitionNode,\n\tfieldsMap: GraphQLFieldMap<unknown, unknown>,\n\tfieldTypes: Record<string, Record<string, string>>,\n) {\n\tconst objectName = node.name.value;\n\tconst fieldName = fieldDefinition.name.value;\n\n\tconst field = fieldsMap[fieldDefinition.name.value];\n\tconst baseName = getBaseType(field.type).name;\n\tconst isDefaultScalar = DEFAULT_SCALARS[baseName] != null;\n\tconst name = isDefaultScalar ? `Types.Scalars[\"${baseName}\"][\"output\"]` : baseName;\n\n\tconst type = wrapTypeWithModifiers(name, field.type, {\n\t\twrapOptional: (str: string) => {\n\t\t\treturn `Types.Maybe<${str}>`;\n\t\t},\n\t\twrapArray: (str: string) => {\n\t\t\treturn `Array<${str}>`;\n\t\t},\n\t});\n\n\tif (fieldTypes[objectName] == null) {\n\t\tfieldTypes[objectName] = {};\n\t}\n\tfieldTypes[objectName][fieldName] = type;\n}\n\nfunction collectObjectFieldArguments(\n\tnode: ObjectTypeDefinitionNode,\n\tfieldDefinition: FieldDefinitionNode,\n\tfieldArguments: Record<string, Record<string, boolean>>,\n) {\n\tconst objectName = node.name.value;\n\tconst fieldName = fieldDefinition.name.value;\n\tconst hasArguments = fieldDefinition.arguments != null && fieldDefinition.arguments.length > 0;\n\n\tif (fieldArguments[objectName] == null) {\n\t\tfieldArguments[objectName] = {};\n\t}\n\tfieldArguments[objectName][fieldName] = hasArguments;\n}\n\nexport function collectObjectFieldTypesAndArguments(schema?: GraphQLSchema) {\n\tconst fieldTypes: Record<string, Record<string, string>> = {};\n\tconst fieldArguments: Record<string, Record<string, boolean>> = {};\n\n\tif (!schema) {\n\t\treturn { fieldTypes, fieldArguments };\n\t}\n\n\tconst schemaTypes = schema.getTypeMap();\n\n\tfor (const type of Object.values(schemaTypes)) {\n\t\tif (type.astNode?.kind !== Kind.OBJECT_TYPE_DEFINITION) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst schemaType = schemaTypes[type.name] as GraphQLObjectType;\n\t\tconst fieldsMap = schemaType.getFields();\n\n\t\tfor (const field of type.astNode.fields ?? []) {\n\t\t\tcollectObjectFieldArguments(type.astNode, field, fieldArguments);\n\t\t\tcollectObjectFieldType(type.astNode, field, fieldsMap, fieldTypes);\n\t\t}\n\t}\n\n\treturn { fieldTypes, fieldArguments };\n}\n\nexport function resolveTypeNode(node: TypeNode): NamedTypeNode {\n\tif (node.kind === Kind.LIST_TYPE) {\n\t\treturn resolveTypeNode(node.type);\n\t}\n\n\tif (node.kind === Kind.NON_NULL_TYPE) {\n\t\treturn resolveTypeNode(node.type);\n\t}\n\n\treturn node;\n}\n\nexport function isGraphQLPrimitive(name: string): boolean {\n\treturn ['String', 'Boolean', 'ID', 'Float', 'Int'].includes(name);\n}\n\nexport function unique<T>(val: T, i: number, all: T[]): boolean {\n\treturn i === all.indexOf(val);\n}\n\nexport function withQuotes(val: string): string {\n\treturn `'${val}'`;\n}\n\nexport function indent(size: number) {\n\tconst space = new Array(size).fill(' ').join('');\n\n\tfunction indentInner(val: string): string {\n\t\treturn val\n\t\t\t.split('\\n')\n\t\t\t.map((line) => `${space}${line}`)\n\t\t\t.join('\\n');\n\t}\n\n\treturn indentInner;\n}\n\nexport function buildBlock({ name, lines }: { name: string; lines: string[] }): string {\n\tif (!lines.length) {\n\t\treturn '';\n\t}\n\n\treturn [`${name} {`, ...lines.map(indent(2)), '};'].join('\\n');\n}\n\nconst getRelativePath = (filepath: string, basePath: string) => {\n\tconst normalizedFilepath = normalize(filepath);\n\tconst normalizedBasePath = ensureStartsWithSeparator(\n\t\tnormalize(ensureEndsWithSeparator(basePath)),\n\t);\n\tconst [, relativePath] = normalizedFilepath.split(normalizedBasePath);\n\treturn relativePath;\n};\n\nexport function groupSourcesByModule(\n\tsources: Source[],\n\tbasePath: string,\n): Record<string, Source[]> {\n\tconst grouped: Record<string, Source[]> = {};\n\n\tfor (const source of sources) {\n\t\tif (!source.location) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst relativePath = getRelativePath(source.location, basePath);\n\n\t\tif (relativePath) {\n\t\t\t// PERF: we could guess the module by matching source.location with a list of already resolved paths\n\t\t\tconst mod = extractModuleDirectory(source.location, basePath);\n\n\t\t\tif (!grouped[mod]) {\n\t\t\t\tgrouped[mod] = [];\n\t\t\t}\n\n\t\t\tgrouped[mod].push(source);\n\t\t}\n\t}\n\n\treturn grouped;\n}\n\nfunction extractModuleDirectory(filepath: string, basePath: string): string {\n\tconst relativePath = getRelativePath(filepath, basePath);\n\n\tconst [moduleDirectory] = relativePath.split(sep);\n\n\treturn moduleDirectory;\n}\n\nexport function stripFilename(path: string) {\n\tconst parsedPath = parse(path);\n\treturn normalize(parsedPath.dir);\n}\n\nexport function normalize(path: string) {\n\treturn path.replace(/\\\\/g, '/');\n}\n\nfunction ensureEndsWithSeparator(path: string) {\n\treturn path.endsWith(sep) ? path : path + sep;\n}\n\nfunction ensureStartsWithSeparator(path: string) {\n\tif (platform() === 'win32') {\n\t\treturn path;\n\t}\n\n\treturn path.startsWith('.')\n\t\t? path.replace(/^(..\\/)|(.\\/)/, '/')\n\t\t: path.startsWith('/')\n\t\t\t? path\n\t\t\t: `/${path}`;\n}\n\n/**\n * Pushes an item to a list only if the list doesn't include the item\n */\nexport function pushUnique<T>(list: T[], item: T): void {\n\tif (!list.includes(item)) {\n\t\tlist.push(item);\n\t}\n}\n\nexport function concatByKey<T extends Record<string, string[]>, K extends keyof T>(\n\tleft: T,\n\tright: T,\n\tkey: K,\n) {\n\t// Remove duplicate, if an element is in right & left, it will be only once in the returned array.\n\treturn [...new Set([...left[key], ...right[key]])];\n}\n\nexport function uniqueByKey<T extends Record<string, string[]>, K extends keyof T>(\n\tleft: T,\n\tright: T,\n\tkey: K,\n) {\n\treturn left[key].filter((item) => !right[key].includes(item));\n}\n\nexport function createObject<K extends string, T>(keys: K[], valueFn: (key: K) => T) {\n\tconst obj: Record<K, T> = {} as Record<K, T>;\n\n\tfor (const key of keys) {\n\t\tobj[key] = valueFn(key);\n\t}\n\n\treturn obj;\n}\n"],"mappings":";;;;;;;AAAA,SAAS,gBAAgB,eAAiC;;;ACC1D,SAAS,WAAW,kBAAkB;AACtC,SAAS,iBAAiB,gCAAgC;AAC1D,YAAY,sBAAsB;;;ACH3B,SAAS,cAIA;AACf,QAAM,QAAQ,oBAAI,IAA8B;AAEhD,SAAO,SAAS,OAAU,WAAmB,KAAa,SAAuC;AAChG,UAAM,WAAW,GAAG,SAAS,IAAI,GAAG;AAEpC,UAAM,cAAc,MAAM,IAAI,QAAQ;AAEtC,QAAI,aAAa;AAChB,aAAO;AAAA,IACR;AAEA,UAAM,QAAQ,QAAQ;AACtB,UAAM,IAAI,UAAU,KAAK;AAEzB,WAAO;AAAA,EACR;AACD;;;ACrBA,SAAS,mCAAAA,wCAAuC;AAChD,SAAS,yBAAyB;AAClC;AAAA,EACC,cAAc;AAAA,OAER;AAEP,SAAuC,sBAAsB;;;ACP7D,SAAS,kBAAkB;AAC3B,SAAS,uCAAuC;AAChD,SAA6B,aAAa;AAEnC,SAAS,YAAY,SAAyB;AACpD,SAAO,WAAW,QAAQ,EAAE,OAAO,OAAO,EAAE,OAAO,KAAK;AACzD;AAEO,SAAS,WAAW,QAA+B;AACzD,SAAO,YAAY,MAAM,gCAAgC,MAAM,CAAC,CAAC;AAClE;;;ADAA,eAAsB,WACrB,kBACA,KACA,eAA4C,CAAC,GAC5C;AACD,QAAM,kBAAkB,MAAM,kBAAkB,kBAAkB;AAAA,IACjE,SAAS,CAA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A,IACA,UAAU,OAAO,KAAK,SAAS;AAC9B,YAAM,QAAQ,MAAM,SAAS,IAAI,gBAAgB;AAEjD,iBAAW,QAAQ,OAAO;AACzB,YAAI,YAAY,aAAa,KAAK,UAAU,KAAK,SAAS,SAAS;AAAA,MACpE;AAEA,aAAO,KAAK;AAAA,IACb;AAAA,EACD,CAAC;AACF;","names":["getCachedDocumentNodeFromSchema","getCachedDocumentNodeFromSchema","isScalarType","Kind","Kind","name","content","Kind","isScalarType","sources","unionsDefinition","types","typePicks","hash","result"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baeta/plugin-graphql",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"baeta",
|
|
6
6
|
"graphql",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"types": "tsc --noEmit"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@baeta/generator-sdk": "^1.0.
|
|
46
|
+
"@baeta/generator-sdk": "^1.0.2",
|
|
47
47
|
"@baeta/util-path": "^1.0.1",
|
|
48
48
|
"@graphql-codegen/core": "^4.0.2",
|
|
49
49
|
"@graphql-codegen/plugin-helpers": "^5.1.0",
|
|
50
|
-
"@graphql-codegen/typescript": "^4.1.
|
|
51
|
-
"@graphql-codegen/visitor-plugin-common": "5.
|
|
52
|
-
"@graphql-tools/graphql-file-loader": "^8.0.
|
|
53
|
-
"@graphql-tools/load": "^8.0
|
|
54
|
-
"@graphql-tools/utils": "^10.8.
|
|
50
|
+
"@graphql-codegen/typescript": "^4.1.6",
|
|
51
|
+
"@graphql-codegen/visitor-plugin-common": "5.8.0",
|
|
52
|
+
"@graphql-tools/graphql-file-loader": "^8.0.19",
|
|
53
|
+
"@graphql-tools/load": "^8.1.0",
|
|
54
|
+
"@graphql-tools/utils": "^10.8.6",
|
|
55
55
|
"auto-bind": "^5.0.1",
|
|
56
56
|
"change-case-all": "2.1.0",
|
|
57
57
|
"murmurhash": "^2.0.1",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@baeta/builder": "^0.0.0",
|
|
62
62
|
"@baeta/tsconfig": "^0.0.0",
|
|
63
|
-
"@types/node": "^22.
|
|
63
|
+
"@types/node": "^22.15.21",
|
|
64
64
|
"@types/parse-filepath": "1.0.2",
|
|
65
|
-
"graphql": "^16.
|
|
66
|
-
"typescript": "^5.8.
|
|
65
|
+
"graphql": "^16.11.0",
|
|
66
|
+
"typescript": "^5.8.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"graphql": "^16.6.0"
|
|
@@ -80,15 +80,6 @@
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
-
"ava": {
|
|
84
|
-
"extensions": {
|
|
85
|
-
"ts": "module"
|
|
86
|
-
},
|
|
87
|
-
"nodeArguments": [
|
|
88
|
-
"--no-warnings",
|
|
89
|
-
"--experimental-transform-types"
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
83
|
"typedocOptions": {
|
|
93
84
|
"entryPoints": [
|
|
94
85
|
"./index.ts"
|