@soda-gql/codegen 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Shota Hatada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,511 @@
1
+ import { Kind } from "graphql";
2
+
3
+ //#region packages/codegen/src/generator.ts
4
+ const builtinScalarTypes = new Map([
5
+ ["ID", {
6
+ input: "string",
7
+ output: "string"
8
+ }],
9
+ ["String", {
10
+ input: "string",
11
+ output: "string"
12
+ }],
13
+ ["Int", {
14
+ input: "number",
15
+ output: "number"
16
+ }],
17
+ ["Float", {
18
+ input: "number",
19
+ output: "number"
20
+ }],
21
+ ["Boolean", {
22
+ input: "boolean",
23
+ output: "boolean"
24
+ }]
25
+ ]);
26
+ const ensureRecord = (collection, key, factory) => {
27
+ const existing = collection.get(key);
28
+ if (existing) {
29
+ return existing;
30
+ }
31
+ const created = factory(key);
32
+ collection.set(key, created);
33
+ return created;
34
+ };
35
+ const addObjectFields = (target, fields) => {
36
+ if (!fields) {
37
+ return;
38
+ }
39
+ for (const field of fields) {
40
+ target.set(field.name.value, field);
41
+ }
42
+ };
43
+ const addInputFields = (target, fields) => {
44
+ if (!fields) {
45
+ return;
46
+ }
47
+ for (const field of fields) {
48
+ target.set(field.name.value, field);
49
+ }
50
+ };
51
+ const addEnumValues = (target, values) => {
52
+ if (!values) {
53
+ return;
54
+ }
55
+ for (const value of values) {
56
+ target.set(value.name.value, value);
57
+ }
58
+ };
59
+ const addUnionMembers = (target, members) => {
60
+ if (!members) {
61
+ return;
62
+ }
63
+ for (const member of members) {
64
+ target.set(member.name.value, member);
65
+ }
66
+ };
67
+ const mergeDirectives = (existing, incoming, precedence) => {
68
+ const current = existing ?? [];
69
+ const next = incoming ? Array.from(incoming) : [];
70
+ return precedence === "definition" ? [...next, ...current] : [...current, ...next];
71
+ };
72
+ const updateOperationTypes = (operationTypes, definition) => {
73
+ for (const operation of definition.operationTypes ?? []) {
74
+ const typeName = operation.type.name.value;
75
+ switch (operation.operation) {
76
+ case "query":
77
+ operationTypes.query = typeName;
78
+ break;
79
+ case "mutation":
80
+ operationTypes.mutation = typeName;
81
+ break;
82
+ case "subscription":
83
+ operationTypes.subscription = typeName;
84
+ break;
85
+ default: break;
86
+ }
87
+ }
88
+ };
89
+ const createSchemaIndex = (document) => {
90
+ const objects = new Map();
91
+ const inputs = new Map();
92
+ const enums = new Map();
93
+ const unions = new Map();
94
+ const scalars = new Map();
95
+ const operationTypes = {};
96
+ for (const definition of document.definitions) {
97
+ switch (definition.kind) {
98
+ case Kind.OBJECT_TYPE_DEFINITION:
99
+ case Kind.OBJECT_TYPE_EXTENSION: {
100
+ const precedence = definition.kind === Kind.OBJECT_TYPE_DEFINITION ? "definition" : "extension";
101
+ const record = ensureRecord(objects, definition.name.value, (name) => ({
102
+ name,
103
+ fields: new Map(),
104
+ directives: []
105
+ }));
106
+ addObjectFields(record.fields, definition.fields);
107
+ record.directives = mergeDirectives(record.directives, definition.directives, precedence);
108
+ break;
109
+ }
110
+ case Kind.INPUT_OBJECT_TYPE_DEFINITION:
111
+ case Kind.INPUT_OBJECT_TYPE_EXTENSION: {
112
+ const precedence = definition.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? "definition" : "extension";
113
+ const record = ensureRecord(inputs, definition.name.value, (name) => ({
114
+ name,
115
+ fields: new Map(),
116
+ directives: []
117
+ }));
118
+ addInputFields(record.fields, definition.fields);
119
+ record.directives = mergeDirectives(record.directives, definition.directives, precedence);
120
+ break;
121
+ }
122
+ case Kind.ENUM_TYPE_DEFINITION:
123
+ case Kind.ENUM_TYPE_EXTENSION: {
124
+ const precedence = definition.kind === Kind.ENUM_TYPE_DEFINITION ? "definition" : "extension";
125
+ const record = ensureRecord(enums, definition.name.value, (name) => ({
126
+ name,
127
+ values: new Map(),
128
+ directives: []
129
+ }));
130
+ addEnumValues(record.values, definition.values);
131
+ record.directives = mergeDirectives(record.directives, definition.directives, precedence);
132
+ break;
133
+ }
134
+ case Kind.UNION_TYPE_DEFINITION:
135
+ case Kind.UNION_TYPE_EXTENSION: {
136
+ const precedence = definition.kind === Kind.UNION_TYPE_DEFINITION ? "definition" : "extension";
137
+ const record = ensureRecord(unions, definition.name.value, (name) => ({
138
+ name,
139
+ members: new Map(),
140
+ directives: []
141
+ }));
142
+ addUnionMembers(record.members, definition.types);
143
+ record.directives = mergeDirectives(record.directives, definition.directives, precedence);
144
+ break;
145
+ }
146
+ case Kind.SCALAR_TYPE_DEFINITION:
147
+ case Kind.SCALAR_TYPE_EXTENSION: {
148
+ const precedence = definition.kind === Kind.SCALAR_TYPE_DEFINITION ? "definition" : "extension";
149
+ const record = ensureRecord(scalars, definition.name.value, (name) => ({
150
+ name,
151
+ directives: []
152
+ }));
153
+ record.directives = mergeDirectives(record.directives, definition.directives, precedence);
154
+ break;
155
+ }
156
+ case Kind.SCHEMA_DEFINITION:
157
+ case Kind.SCHEMA_EXTENSION:
158
+ updateOperationTypes(operationTypes, definition);
159
+ break;
160
+ default: break;
161
+ }
162
+ }
163
+ if (!operationTypes.query && objects.has("Query")) {
164
+ operationTypes.query = "Query";
165
+ }
166
+ if (!operationTypes.mutation && objects.has("Mutation")) {
167
+ operationTypes.mutation = "Mutation";
168
+ }
169
+ if (!operationTypes.subscription && objects.has("Subscription")) {
170
+ operationTypes.subscription = "Subscription";
171
+ }
172
+ return {
173
+ objects,
174
+ inputs,
175
+ enums,
176
+ unions,
177
+ scalars,
178
+ operationTypes
179
+ };
180
+ };
181
+ const collectTypeLevels = (type, nonNull = false, levels = []) => {
182
+ if (type.kind === Kind.NON_NULL_TYPE) {
183
+ return collectTypeLevels(type.type, true, levels);
184
+ }
185
+ if (type.kind === Kind.LIST_TYPE) {
186
+ levels.push({
187
+ kind: "list",
188
+ nonNull
189
+ });
190
+ return collectTypeLevels(type.type, false, levels);
191
+ }
192
+ levels.push({
193
+ kind: "named",
194
+ nonNull
195
+ });
196
+ return {
197
+ name: type.name.value,
198
+ levels
199
+ };
200
+ };
201
+ const buildTypeModifier = (levels) => {
202
+ let modifier = "";
203
+ for (const level of levels.slice().reverse()) {
204
+ if (level.kind === "named") {
205
+ modifier = level.nonNull ? "!" : "";
206
+ continue;
207
+ }
208
+ const rest = modifier;
209
+ const base = rest.startsWith("!") ? `![]${rest.slice(1)}` : `[]${rest}`;
210
+ modifier = level.nonNull ? `${base}!` : base;
211
+ }
212
+ return modifier || "?";
213
+ };
214
+ const parseTypeReference = (type) => {
215
+ const { name, levels } = collectTypeLevels(type);
216
+ return {
217
+ name,
218
+ modifier: buildTypeModifier(levels)
219
+ };
220
+ };
221
+ const renderType = (name, modifier) => JSON.stringify(`${name}:${modifier}`);
222
+ const isScalarName = (schema, name) => builtinScalarTypes.has(name) || schema.scalars.has(name);
223
+ const isEnumName = (schema, name) => schema.enums.has(name);
224
+ const _isInputName = (schema, name) => schema.inputs.has(name);
225
+ const isUnionName = (schema, name) => schema.unions.has(name);
226
+ const isObjectName = (schema, name) => schema.objects.has(name);
227
+ const renderConstValue = (value) => {
228
+ switch (value.kind) {
229
+ case Kind.NULL: return "null";
230
+ case Kind.INT:
231
+ case Kind.FLOAT: return value.value;
232
+ case Kind.STRING:
233
+ case Kind.ENUM: return JSON.stringify(value.value);
234
+ case Kind.BOOLEAN: return value.value ? "true" : "false";
235
+ case Kind.LIST: return `[${value.values.map((item) => renderConstValue(item)).join(", ")}]`;
236
+ case Kind.OBJECT: {
237
+ if (value.fields.length === 0) {
238
+ return "{}";
239
+ }
240
+ const entries = value.fields.map((field) => `${field.name.value}: ${renderConstValue(field.value)}`);
241
+ return `{ ${entries.join(", ")} }`;
242
+ }
243
+ }
244
+ };
245
+ const renderConstArgumentMap = (args) => {
246
+ const entries = (args ?? []).map((arg) => `${arg.name.value}: ${renderConstValue(arg.value)}`);
247
+ return renderPropertyLines({
248
+ entries,
249
+ indentSize: 8
250
+ });
251
+ };
252
+ const renderDirectives = (directives) => {
253
+ const entries = (directives ?? []).map((directive) => `${directive.name.value}: ${renderConstArgumentMap(directive.arguments)}`);
254
+ return renderPropertyLines({
255
+ entries,
256
+ indentSize: 8
257
+ });
258
+ };
259
+ const renderDefaultValue = (value) => value ? `() => (${renderConstValue(value)})` : "null";
260
+ const renderInputRef = (schema, definition) => {
261
+ const { name, modifier } = parseTypeReference(definition.type);
262
+ const tuple = renderType(name, modifier);
263
+ const defaultValue = renderDefaultValue(definition.defaultValue ?? null);
264
+ const directives = renderDirectives(definition.directives);
265
+ if (isScalarName(schema, name)) {
266
+ return `unsafeInputType.scalar(${tuple}, { default: ${defaultValue}, directives: ${directives} })`;
267
+ }
268
+ if (isEnumName(schema, name)) {
269
+ return `unsafeInputType.enum(${tuple}, { default: ${defaultValue}, directives: ${directives} })`;
270
+ }
271
+ return `unsafeInputType.input(${tuple}, { default: ${defaultValue}, directives: ${directives} })`;
272
+ };
273
+ const renderArgumentMap = (schema, args) => {
274
+ const entries = [...args ?? []].sort((left, right) => left.name.value.localeCompare(right.name.value)).map((arg) => `${arg.name.value}: ${renderInputRef(schema, arg)}`);
275
+ return renderPropertyLines({
276
+ entries,
277
+ indentSize: 8
278
+ });
279
+ };
280
+ const renderOutputRef = (schema, type, args, directives) => {
281
+ const { name, modifier } = parseTypeReference(type);
282
+ const modifiedType = renderType(name, modifier);
283
+ const argumentMap = renderArgumentMap(schema, args);
284
+ const directiveMap = renderDirectives(directives);
285
+ if (isScalarName(schema, name)) {
286
+ return `unsafeOutputType.scalar(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;
287
+ }
288
+ if (isEnumName(schema, name)) {
289
+ return `unsafeOutputType.enum(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;
290
+ }
291
+ if (isUnionName(schema, name)) {
292
+ return `unsafeOutputType.union(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;
293
+ }
294
+ if (isObjectName(schema, name)) {
295
+ return `unsafeOutputType.object(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;
296
+ }
297
+ return `unsafeOutputType.scalar(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;
298
+ };
299
+ const renderPropertyLines = ({ entries, indentSize }) => {
300
+ if (entries.length === 0) {
301
+ return "{}";
302
+ }
303
+ const indent = " ".repeat(indentSize);
304
+ const lastIndent = " ".repeat(indentSize - 2);
305
+ return [
306
+ "{",
307
+ `${indent}${entries.join(`,\n${indent}`)},`,
308
+ `${lastIndent}}`
309
+ ].join(`\n`);
310
+ };
311
+ const renderObjectFields = (schema, fields) => {
312
+ const entries = Array.from(fields.values()).sort((left, right) => left.name.value.localeCompare(right.name.value)).map((field) => `${field.name.value}: ${renderOutputRef(schema, field.type, field.arguments, field.directives)}`);
313
+ return renderPropertyLines({
314
+ entries,
315
+ indentSize: 6
316
+ });
317
+ };
318
+ const renderInputFields = (schema, fields) => {
319
+ const entries = Array.from(fields.values()).sort((left, right) => left.name.value.localeCompare(right.name.value)).map((field) => `${field.name.value}: ${renderInputRef(schema, field)}`);
320
+ return renderPropertyLines({
321
+ entries,
322
+ indentSize: 6
323
+ });
324
+ };
325
+ const renderScalarDefinition = (record) => {
326
+ const typeInfo = builtinScalarTypes.get(record.name) ?? {
327
+ input: "string",
328
+ output: "string"
329
+ };
330
+ const scalarType = `type<{ input: ${typeInfo.input}; output: ${typeInfo.output} }>()`;
331
+ return `${record.name}: define("${record.name}").scalar(${scalarType}, ${renderDirectives(record.directives)})`;
332
+ };
333
+ const renderObjectDefinition = (schema, typeName) => {
334
+ const record = schema.objects.get(typeName);
335
+ if (!record) {
336
+ return "";
337
+ }
338
+ const fields = renderObjectFields(schema, record.fields);
339
+ return `${record.name}: define("${record.name}").object(${fields}, ${renderDirectives(record.directives)})`;
340
+ };
341
+ const renderInputDefinition = (schema, typeName) => {
342
+ const record = schema.inputs.get(typeName);
343
+ if (!record) {
344
+ return "";
345
+ }
346
+ const fields = renderInputFields(schema, record.fields);
347
+ return `${record.name}: define("${record.name}").input(${fields}, ${renderDirectives(record.directives)})`;
348
+ };
349
+ const renderEnumDefinition = (schema, typeName) => {
350
+ const record = schema.enums.get(typeName);
351
+ if (!record) {
352
+ return "";
353
+ }
354
+ const values = Array.from(record.values.values()).sort((left, right) => left.name.value.localeCompare(right.name.value)).map((value) => `${value.name.value}: true`).join(", ");
355
+ const body = values.length === 0 ? "{}" : `{ ${values} }`;
356
+ return `${record.name}: define("${record.name}").enum(${body}, ${renderDirectives(record.directives)})`;
357
+ };
358
+ const renderUnionDefinition = (schema, typeName) => {
359
+ const record = schema.unions.get(typeName);
360
+ if (!record) {
361
+ return "";
362
+ }
363
+ const members = Array.from(record.members.values()).sort((left, right) => left.name.value.localeCompare(right.name.value)).map((member) => `${member.name.value}: true`).join(", ");
364
+ const body = members.length === 0 ? "{}" : `{ ${members} }`;
365
+ return `${record.name}: define("${record.name}").union(${body}, ${renderDirectives(record.directives)})`;
366
+ };
367
+ const collectObjectTypeNames = (schema) => Array.from(schema.objects.keys()).filter((name) => !name.startsWith("__")).sort((left, right) => left.localeCompare(right));
368
+ const collectInputTypeNames = (schema) => Array.from(schema.inputs.keys()).filter((name) => !name.startsWith("__")).sort((left, right) => left.localeCompare(right));
369
+ const collectEnumTypeNames = (schema) => Array.from(schema.enums.keys()).filter((name) => !name.startsWith("__")).sort((left, right) => left.localeCompare(right));
370
+ const collectUnionTypeNames = (schema) => Array.from(schema.unions.keys()).filter((name) => !name.startsWith("__")).sort((left, right) => left.localeCompare(right));
371
+ const collectScalarNames = (schema) => Array.from(schema.scalars.keys()).filter((name) => !name.startsWith("__")).sort((left, right) => left.localeCompare(right));
372
+ const multiRuntimeTemplate = ($$) => {
373
+ const imports = [];
374
+ const adapterAliases = new Map();
375
+ const scalarAliases = new Map();
376
+ if ($$.injection.mode === "inject") {
377
+ for (const [schemaName, injection] of $$.injection.perSchema) {
378
+ const adapterAlias = `adapter_${schemaName}`;
379
+ const scalarAlias = `scalar_${schemaName}`;
380
+ adapterAliases.set(schemaName, adapterAlias);
381
+ scalarAliases.set(schemaName, scalarAlias);
382
+ imports.push(`import { adapter as ${adapterAlias} } from "${injection.adapterImportPath}";`);
383
+ imports.push(`import { scalar as ${scalarAlias} } from "${injection.scalarImportPath}";`);
384
+ }
385
+ }
386
+ const extraImports = imports.length > 0 ? `${imports.join("\n")}\n` : "";
387
+ const schemaBlocks = [];
388
+ const gqlEntries = [];
389
+ for (const [name, config] of Object.entries($$.schemas)) {
390
+ const schemaVar = `${name}Schema`;
391
+ const adapterVar = $$.injection.mode === "inject" ? adapterAliases.get(name) : `adapter_${name}`;
392
+ const scalarBlock = $$.injection.mode === "inject" ? scalarAliases.get(name) : config.scalarBlock;
393
+ const adapterDefinition = $$.injection.mode === "inject" ? "" : `const ${adapterVar} = createRuntimeAdapter(({ type }) => ({\n nonGraphqlErrorType: type<{ type: "non-graphql-error"; cause: unknown }>(),\n}));\n`;
394
+ schemaBlocks.push(`${adapterDefinition}
395
+ const ${schemaVar} = {
396
+ operations: defineOperationRoots({
397
+ query: "${config.queryType}",
398
+ mutation: "${config.mutationType}",
399
+ subscription: "${config.subscriptionType}",
400
+ }),
401
+ scalar: ${scalarBlock},
402
+ enum: ${config.enumBlock},
403
+ input: ${config.inputBlock},
404
+ object: ${config.objectBlock},
405
+ union: ${config.unionBlock},
406
+ } satisfies AnyGraphqlSchema;
407
+
408
+ export type Schema_${name} = typeof ${schemaVar} & { _?: never };
409
+ export type Adapter_${name} = typeof ${adapterVar} & { _?: never };`);
410
+ gqlEntries.push(` ${name}: createGqlElementComposer<Schema_${name}, Adapter_${name}>(${schemaVar})`);
411
+ }
412
+ const runtimeImport = $$.injection.mode === "inline" ? "\nimport { createRuntimeAdapter } from \"@soda-gql/runtime\";" : "";
413
+ return `\
414
+ import {
415
+ type AnyGraphqlSchema,
416
+ createGqlElementComposer,
417
+ define,
418
+ defineOperationRoots,
419
+ unsafeInputType,
420
+ unsafeOutputType,
421
+ } from "@soda-gql/core";${runtimeImport}
422
+ ${extraImports}
423
+ ${schemaBlocks.join("\n")}
424
+
425
+ export const gql = {
426
+ ${gqlEntries.join(",\n")}
427
+ };
428
+ `;
429
+ };
430
+ const generateMultiSchemaModule = (schemas, options) => {
431
+ const schemaConfigs = {};
432
+ const allStats = {
433
+ objects: 0,
434
+ enums: 0,
435
+ inputs: 0,
436
+ unions: 0
437
+ };
438
+ for (const [name, document] of schemas.entries()) {
439
+ const schema = createSchemaIndex(document);
440
+ const builtinScalarDefinitions = Array.from(builtinScalarTypes.keys()).map((name$1) => renderScalarDefinition(schema.scalars.get(name$1) ?? {
441
+ name: name$1,
442
+ directives: []
443
+ }));
444
+ const customScalarDefinitions = collectScalarNames(schema).filter((name$1) => !builtinScalarTypes.has(name$1)).map((name$1) => {
445
+ const record = schema.scalars.get(name$1);
446
+ return record ? renderScalarDefinition(record) : "";
447
+ }).filter((definition) => definition.length > 0);
448
+ const allScalarDefinitions = builtinScalarDefinitions.concat(customScalarDefinitions);
449
+ const objectTypeNames = collectObjectTypeNames(schema);
450
+ const enumTypeNames = collectEnumTypeNames(schema);
451
+ const inputTypeNames = collectInputTypeNames(schema);
452
+ const unionTypeNames = collectUnionTypeNames(schema);
453
+ const scalarBlock = renderPropertyLines({
454
+ entries: allScalarDefinitions,
455
+ indentSize: 4
456
+ });
457
+ const enumDefinitions = enumTypeNames.map((name$1) => renderEnumDefinition(schema, name$1)).filter((definition) => definition.length > 0);
458
+ const enumBlock = renderPropertyLines({
459
+ entries: enumDefinitions,
460
+ indentSize: 4
461
+ });
462
+ const inputDefinitions = inputTypeNames.map((name$1) => renderInputDefinition(schema, name$1)).filter((definition) => definition.length > 0);
463
+ const inputBlock = renderPropertyLines({
464
+ entries: inputDefinitions,
465
+ indentSize: 4
466
+ });
467
+ const objectDefinitions = objectTypeNames.map((name$1) => renderObjectDefinition(schema, name$1)).filter((definition) => definition.length > 0);
468
+ const objectBlock = renderPropertyLines({
469
+ entries: objectDefinitions,
470
+ indentSize: 4
471
+ });
472
+ const unionDefinitions = unionTypeNames.map((name$1) => renderUnionDefinition(schema, name$1)).filter((definition) => definition.length > 0);
473
+ const unionBlock = renderPropertyLines({
474
+ entries: unionDefinitions,
475
+ indentSize: 4
476
+ });
477
+ const queryType = schema.operationTypes.query ?? "Query";
478
+ const mutationType = schema.operationTypes.mutation ?? "Mutation";
479
+ const subscriptionType = schema.operationTypes.subscription ?? "Subscription";
480
+ schemaConfigs[name] = {
481
+ queryType,
482
+ mutationType,
483
+ subscriptionType,
484
+ scalarBlock,
485
+ enumBlock,
486
+ inputBlock,
487
+ objectBlock,
488
+ unionBlock
489
+ };
490
+ allStats.objects += objectDefinitions.length;
491
+ allStats.enums += enumDefinitions.length;
492
+ allStats.inputs += inputDefinitions.length;
493
+ allStats.unions += unionDefinitions.length;
494
+ }
495
+ const injection = options?.injection ? {
496
+ mode: "inject",
497
+ perSchema: options.injection
498
+ } : { mode: "inline" };
499
+ const code = multiRuntimeTemplate({
500
+ schemas: schemaConfigs,
501
+ injection
502
+ });
503
+ return {
504
+ code,
505
+ stats: allStats
506
+ };
507
+ };
508
+
509
+ //#endregion
510
+ export { createSchemaIndex, generateMultiSchemaModule };
511
+ //# sourceMappingURL=generator-BgvqYNQA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator-BgvqYNQA.js","names":["operationTypes: OperationTypeNames","modifier: TypeModifier | \"\"","rest: TypeModifier | \"\"","base: TypeModifier","imports: string[]","schemaBlocks: string[]","gqlEntries: string[]","schemaConfigs: Record<string, any>","name","injection: RuntimeTemplateInjection"],"sources":["../src/generator.ts"],"sourcesContent":["import type { TypeModifier } from \"@soda-gql/core\";\nimport {\n type ConstDirectiveNode,\n type ConstValueNode,\n type DocumentNode,\n type EnumValueDefinitionNode,\n type FieldDefinitionNode,\n type InputValueDefinitionNode,\n Kind,\n type NamedTypeNode,\n type SchemaDefinitionNode,\n type SchemaExtensionNode,\n type TypeNode,\n} from \"graphql\";\n\nconst builtinScalarTypes = new Map<string, { readonly input: string; readonly output: string }>([\n [\"ID\", { input: \"string\", output: \"string\" }],\n [\"String\", { input: \"string\", output: \"string\" }],\n [\"Int\", { input: \"number\", output: \"number\" }],\n [\"Float\", { input: \"number\", output: \"number\" }],\n [\"Boolean\", { input: \"boolean\", output: \"boolean\" }],\n]);\n\ntype OperationTypeNames = {\n query?: string;\n mutation?: string;\n subscription?: string;\n};\n\ntype ObjectRecord = {\n readonly name: string;\n readonly fields: Map<string, FieldDefinitionNode>;\n directives: ConstDirectiveNode[];\n};\n\ntype InputRecord = {\n readonly name: string;\n readonly fields: Map<string, InputValueDefinitionNode>;\n directives: ConstDirectiveNode[];\n};\n\ntype EnumRecord = {\n readonly name: string;\n readonly values: Map<string, EnumValueDefinitionNode>;\n directives: ConstDirectiveNode[];\n};\n\ntype UnionRecord = {\n readonly name: string;\n readonly members: Map<string, NamedTypeNode>;\n directives: ConstDirectiveNode[];\n};\n\ntype ScalarRecord = {\n readonly name: string;\n directives: ConstDirectiveNode[];\n};\n\ntype SchemaIndex = {\n readonly objects: Map<string, ObjectRecord>;\n readonly inputs: Map<string, InputRecord>;\n readonly enums: Map<string, EnumRecord>;\n readonly unions: Map<string, UnionRecord>;\n readonly scalars: Map<string, ScalarRecord>;\n readonly operationTypes: OperationTypeNames;\n};\n\nconst ensureRecord = <T>(collection: Map<string, T>, key: string, factory: (name: string) => T): T => {\n const existing = collection.get(key);\n if (existing) {\n return existing;\n }\n\n const created = factory(key);\n collection.set(key, created);\n return created;\n};\n\nconst addObjectFields = (target: Map<string, FieldDefinitionNode>, fields: readonly FieldDefinitionNode[] | undefined): void => {\n if (!fields) {\n return;\n }\n\n for (const field of fields) {\n target.set(field.name.value, field);\n }\n};\n\nconst addInputFields = (\n target: Map<string, InputValueDefinitionNode>,\n fields: readonly InputValueDefinitionNode[] | undefined,\n): void => {\n if (!fields) {\n return;\n }\n\n for (const field of fields) {\n target.set(field.name.value, field);\n }\n};\n\nconst addEnumValues = (\n target: Map<string, EnumValueDefinitionNode>,\n values: readonly EnumValueDefinitionNode[] | undefined,\n): void => {\n if (!values) {\n return;\n }\n\n for (const value of values) {\n target.set(value.name.value, value);\n }\n};\n\nconst addUnionMembers = (target: Map<string, NamedTypeNode>, members: readonly NamedTypeNode[] | undefined): void => {\n if (!members) {\n return;\n }\n\n for (const member of members) {\n target.set(member.name.value, member);\n }\n};\n\nconst mergeDirectives = (\n existing: ConstDirectiveNode[] | undefined,\n incoming: readonly ConstDirectiveNode[] | undefined,\n precedence: \"definition\" | \"extension\",\n): ConstDirectiveNode[] => {\n const current = existing ?? [];\n const next = incoming ? Array.from(incoming) : [];\n return precedence === \"definition\" ? [...next, ...current] : [...current, ...next];\n};\n\nconst updateOperationTypes = (\n operationTypes: OperationTypeNames,\n definition: SchemaDefinitionNode | SchemaExtensionNode,\n): void => {\n for (const operation of definition.operationTypes ?? []) {\n const typeName = operation.type.name.value;\n switch (operation.operation) {\n case \"query\":\n operationTypes.query = typeName;\n break;\n case \"mutation\":\n operationTypes.mutation = typeName;\n break;\n case \"subscription\":\n operationTypes.subscription = typeName;\n break;\n default:\n break;\n }\n }\n};\n\nexport const createSchemaIndex = (document: DocumentNode): SchemaIndex => {\n const objects = new Map<string, ObjectRecord>();\n const inputs = new Map<string, InputRecord>();\n const enums = new Map<string, EnumRecord>();\n const unions = new Map<string, UnionRecord>();\n const scalars = new Map<string, ScalarRecord>();\n const operationTypes: OperationTypeNames = {};\n\n for (const definition of document.definitions) {\n switch (definition.kind) {\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION: {\n const precedence = definition.kind === Kind.OBJECT_TYPE_DEFINITION ? \"definition\" : \"extension\";\n const record = ensureRecord(objects, definition.name.value, (name) => ({\n name,\n fields: new Map<string, FieldDefinitionNode>(),\n directives: [],\n }));\n addObjectFields(record.fields, definition.fields);\n record.directives = mergeDirectives(record.directives, definition.directives, precedence);\n break;\n }\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION: {\n const precedence = definition.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? \"definition\" : \"extension\";\n const record = ensureRecord(inputs, definition.name.value, (name) => ({\n name,\n fields: new Map<string, InputValueDefinitionNode>(),\n directives: [],\n }));\n addInputFields(record.fields, definition.fields);\n record.directives = mergeDirectives(record.directives, definition.directives, precedence);\n break;\n }\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION: {\n const precedence = definition.kind === Kind.ENUM_TYPE_DEFINITION ? \"definition\" : \"extension\";\n const record = ensureRecord(enums, definition.name.value, (name) => ({\n name,\n values: new Map<string, EnumValueDefinitionNode>(),\n directives: [],\n }));\n addEnumValues(record.values, definition.values);\n record.directives = mergeDirectives(record.directives, definition.directives, precedence);\n break;\n }\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION: {\n const precedence = definition.kind === Kind.UNION_TYPE_DEFINITION ? \"definition\" : \"extension\";\n const record = ensureRecord(unions, definition.name.value, (name) => ({\n name,\n members: new Map<string, NamedTypeNode>(),\n directives: [],\n }));\n addUnionMembers(record.members, definition.types);\n record.directives = mergeDirectives(record.directives, definition.directives, precedence);\n break;\n }\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION: {\n const precedence = definition.kind === Kind.SCALAR_TYPE_DEFINITION ? \"definition\" : \"extension\";\n const record = ensureRecord(scalars, definition.name.value, (name) => ({\n name,\n directives: [],\n }));\n record.directives = mergeDirectives(record.directives, definition.directives, precedence);\n break;\n }\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n updateOperationTypes(operationTypes, definition);\n break;\n default:\n break;\n }\n }\n\n if (!operationTypes.query && objects.has(\"Query\")) {\n operationTypes.query = \"Query\";\n }\n if (!operationTypes.mutation && objects.has(\"Mutation\")) {\n operationTypes.mutation = \"Mutation\";\n }\n if (!operationTypes.subscription && objects.has(\"Subscription\")) {\n operationTypes.subscription = \"Subscription\";\n }\n\n return {\n objects,\n inputs,\n enums,\n unions,\n scalars,\n operationTypes,\n } satisfies SchemaIndex;\n};\n\ntype TypeLevel = {\n readonly kind: \"list\" | \"named\";\n readonly nonNull: boolean;\n};\n\nconst collectTypeLevels = (\n type: TypeNode,\n nonNull = false,\n levels: TypeLevel[] = [],\n): { readonly name: string; readonly levels: TypeLevel[] } => {\n if (type.kind === Kind.NON_NULL_TYPE) {\n return collectTypeLevels(type.type, true, levels);\n }\n\n if (type.kind === Kind.LIST_TYPE) {\n levels.push({ kind: \"list\", nonNull });\n return collectTypeLevels(type.type, false, levels);\n }\n\n levels.push({ kind: \"named\", nonNull });\n return { name: type.name.value, levels };\n};\n\nconst buildTypeModifier = (levels: TypeLevel[]): TypeModifier => {\n let modifier: TypeModifier | \"\" = \"\";\n\n for (const level of levels.slice().reverse()) {\n if (level.kind === \"named\") {\n modifier = level.nonNull ? \"!\" : \"\";\n continue;\n }\n\n const rest: TypeModifier | \"\" = modifier;\n const base: TypeModifier = rest.startsWith(\"!\") ? `![]${rest.slice(1)}` : `[]${rest}`;\n modifier = level.nonNull ? `${base}!` : base;\n }\n\n return modifier || \"?\";\n};\n\nconst parseTypeReference = (type: TypeNode): { readonly name: string; readonly modifier: string } => {\n const { name, levels } = collectTypeLevels(type);\n return { name, modifier: buildTypeModifier(levels) };\n};\n\nconst renderType = (name: string, modifier: string): string => JSON.stringify(`${name}:${modifier}`);\n\nconst isScalarName = (schema: SchemaIndex, name: string): boolean => builtinScalarTypes.has(name) || schema.scalars.has(name);\nconst isEnumName = (schema: SchemaIndex, name: string): boolean => schema.enums.has(name);\nconst _isInputName = (schema: SchemaIndex, name: string): boolean => schema.inputs.has(name);\nconst isUnionName = (schema: SchemaIndex, name: string): boolean => schema.unions.has(name);\nconst isObjectName = (schema: SchemaIndex, name: string): boolean => schema.objects.has(name);\n\nconst renderConstValue = (value: ConstValueNode): string => {\n switch (value.kind) {\n case Kind.NULL:\n return \"null\";\n case Kind.INT:\n case Kind.FLOAT:\n return value.value;\n case Kind.STRING:\n case Kind.ENUM:\n return JSON.stringify(value.value);\n case Kind.BOOLEAN:\n return value.value ? \"true\" : \"false\";\n case Kind.LIST:\n return `[${value.values.map((item) => renderConstValue(item)).join(\", \")}]`;\n case Kind.OBJECT: {\n if (value.fields.length === 0) {\n return \"{}\";\n }\n const entries = value.fields.map((field) => `${field.name.value}: ${renderConstValue(field.value)}`);\n return `{ ${entries.join(\", \")} }`;\n }\n }\n};\n\nconst renderConstArgumentMap = (\n args: readonly { readonly name: { readonly value: string }; readonly value: ConstValueNode }[] | undefined,\n): string => {\n const entries = (args ?? []).map((arg) => `${arg.name.value}: ${renderConstValue(arg.value)}`);\n return renderPropertyLines({ entries, indentSize: 8 });\n};\n\nconst renderDirectives = (directives: readonly ConstDirectiveNode[] | undefined): string => {\n const entries = (directives ?? []).map(\n (directive) => `${directive.name.value}: ${renderConstArgumentMap(directive.arguments)}`,\n );\n return renderPropertyLines({ entries, indentSize: 8 });\n};\n\nconst renderDefaultValue = (value: ConstValueNode | null | undefined): string =>\n value ? `() => (${renderConstValue(value)})` : \"null\";\n\nconst renderInputRef = (schema: SchemaIndex, definition: InputValueDefinitionNode): string => {\n const { name, modifier } = parseTypeReference(definition.type);\n const tuple = renderType(name, modifier);\n const defaultValue = renderDefaultValue(definition.defaultValue ?? null);\n const directives = renderDirectives(definition.directives);\n\n if (isScalarName(schema, name)) {\n return `unsafeInputType.scalar(${tuple}, { default: ${defaultValue}, directives: ${directives} })`;\n }\n\n if (isEnumName(schema, name)) {\n return `unsafeInputType.enum(${tuple}, { default: ${defaultValue}, directives: ${directives} })`;\n }\n\n return `unsafeInputType.input(${tuple}, { default: ${defaultValue}, directives: ${directives} })`;\n};\n\nconst renderArgumentMap = (schema: SchemaIndex, args: readonly InputValueDefinitionNode[] | undefined): string => {\n const entries = [...(args ?? [])]\n .sort((left, right) => left.name.value.localeCompare(right.name.value))\n .map((arg) => `${arg.name.value}: ${renderInputRef(schema, arg)}`);\n\n return renderPropertyLines({ entries, indentSize: 8 });\n};\n\nconst renderOutputRef = (\n schema: SchemaIndex,\n type: TypeNode,\n args: readonly InputValueDefinitionNode[] | undefined,\n directives: readonly ConstDirectiveNode[] | undefined,\n): string => {\n const { name, modifier } = parseTypeReference(type);\n const modifiedType = renderType(name, modifier);\n const argumentMap = renderArgumentMap(schema, args);\n const directiveMap = renderDirectives(directives);\n\n if (isScalarName(schema, name)) {\n return `unsafeOutputType.scalar(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;\n }\n\n if (isEnumName(schema, name)) {\n return `unsafeOutputType.enum(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;\n }\n\n if (isUnionName(schema, name)) {\n return `unsafeOutputType.union(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;\n }\n\n if (isObjectName(schema, name)) {\n return `unsafeOutputType.object(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;\n }\n\n return `unsafeOutputType.scalar(${modifiedType}, { arguments: ${argumentMap}, directives: ${directiveMap} })`;\n};\n\nconst renderPropertyLines = ({ entries, indentSize }: { entries: string[]; indentSize: number }) => {\n if (entries.length === 0) {\n return \"{}\";\n }\n\n const indent = \" \".repeat(indentSize);\n const lastIndent = \" \".repeat(indentSize - 2);\n return [\"{\", `${indent}${entries.join(`,\\n${indent}`)},`, `${lastIndent}}`].join(`\\n`);\n};\n\nconst renderObjectFields = (schema: SchemaIndex, fields: Map<string, FieldDefinitionNode>): string => {\n const entries = Array.from(fields.values())\n .sort((left, right) => left.name.value.localeCompare(right.name.value))\n .map((field) => `${field.name.value}: ${renderOutputRef(schema, field.type, field.arguments, field.directives)}`);\n\n return renderPropertyLines({ entries, indentSize: 6 });\n};\n\nconst renderInputFields = (schema: SchemaIndex, fields: Map<string, InputValueDefinitionNode>): string => {\n const entries = Array.from(fields.values())\n .sort((left, right) => left.name.value.localeCompare(right.name.value))\n .map((field) => `${field.name.value}: ${renderInputRef(schema, field)}`);\n\n return renderPropertyLines({ entries, indentSize: 6 });\n};\n\nconst renderScalarDefinition = (record: ScalarRecord): string => {\n const typeInfo = builtinScalarTypes.get(record.name) ?? { input: \"string\", output: \"string\" };\n const scalarType = `type<{ input: ${typeInfo.input}; output: ${typeInfo.output} }>()`;\n return `${record.name}: define(\"${record.name}\").scalar(${scalarType}, ${renderDirectives(record.directives)})`;\n};\n\nconst renderObjectDefinition = (schema: SchemaIndex, typeName: string): string => {\n const record = schema.objects.get(typeName);\n if (!record) {\n return \"\";\n }\n\n const fields = renderObjectFields(schema, record.fields);\n return `${record.name}: define(\"${record.name}\").object(${fields}, ${renderDirectives(record.directives)})`;\n};\n\nconst renderInputDefinition = (schema: SchemaIndex, typeName: string): string => {\n const record = schema.inputs.get(typeName);\n if (!record) {\n return \"\";\n }\n\n const fields = renderInputFields(schema, record.fields);\n return `${record.name}: define(\"${record.name}\").input(${fields}, ${renderDirectives(record.directives)})`;\n};\n\nconst renderEnumDefinition = (schema: SchemaIndex, typeName: string): string => {\n const record = schema.enums.get(typeName);\n if (!record) {\n return \"\";\n }\n\n const values = Array.from(record.values.values())\n .sort((left, right) => left.name.value.localeCompare(right.name.value))\n .map((value) => `${value.name.value}: true`)\n .join(\", \");\n const body = values.length === 0 ? \"{}\" : `{ ${values} }`;\n\n return `${record.name}: define(\"${record.name}\").enum(${body}, ${renderDirectives(record.directives)})`;\n};\n\nconst renderUnionDefinition = (schema: SchemaIndex, typeName: string): string => {\n const record = schema.unions.get(typeName);\n if (!record) {\n return \"\";\n }\n\n const members = Array.from(record.members.values())\n .sort((left, right) => left.name.value.localeCompare(right.name.value))\n .map((member) => `${member.name.value}: true`)\n .join(\", \");\n const body = members.length === 0 ? \"{}\" : `{ ${members} }`;\n\n return `${record.name}: define(\"${record.name}\").union(${body}, ${renderDirectives(record.directives)})`;\n};\n\nconst collectObjectTypeNames = (schema: SchemaIndex): string[] =>\n Array.from(schema.objects.keys())\n .filter((name) => !name.startsWith(\"__\"))\n .sort((left, right) => left.localeCompare(right));\n\nconst collectInputTypeNames = (schema: SchemaIndex): string[] =>\n Array.from(schema.inputs.keys())\n .filter((name) => !name.startsWith(\"__\"))\n .sort((left, right) => left.localeCompare(right));\n\nconst collectEnumTypeNames = (schema: SchemaIndex): string[] =>\n Array.from(schema.enums.keys())\n .filter((name) => !name.startsWith(\"__\"))\n .sort((left, right) => left.localeCompare(right));\n\nconst collectUnionTypeNames = (schema: SchemaIndex): string[] =>\n Array.from(schema.unions.keys())\n .filter((name) => !name.startsWith(\"__\"))\n .sort((left, right) => left.localeCompare(right));\n\nconst collectScalarNames = (schema: SchemaIndex): string[] =>\n Array.from(schema.scalars.keys())\n .filter((name) => !name.startsWith(\"__\"))\n .sort((left, right) => left.localeCompare(right));\n\nexport type GeneratedModule = {\n readonly code: string;\n readonly stats: {\n readonly objects: number;\n readonly enums: number;\n readonly inputs: number;\n readonly unions: number;\n };\n};\n\ntype PerSchemaInjection = {\n readonly adapterImportPath: string;\n readonly scalarImportPath: string;\n};\n\ntype RuntimeTemplateInjection =\n | { readonly mode: \"inline\" }\n | {\n readonly mode: \"inject\";\n readonly perSchema: Map<string, PerSchemaInjection>;\n };\n\nexport type RuntimeGenerationOptions = {\n readonly injection?: Map<string, PerSchemaInjection>;\n};\n\ntype MultiRuntimeTemplateOptions = {\n readonly schemas: Record<\n string,\n {\n readonly queryType: string;\n readonly mutationType: string;\n readonly subscriptionType: string;\n readonly scalarBlock: string;\n readonly enumBlock: string;\n readonly inputBlock: string;\n readonly objectBlock: string;\n readonly unionBlock: string;\n }\n >;\n readonly injection: RuntimeTemplateInjection;\n};\n\nconst multiRuntimeTemplate = ($$: MultiRuntimeTemplateOptions) => {\n // Build imports based on injection mode\n const imports: string[] = [];\n const adapterAliases = new Map<string, string>();\n const scalarAliases = new Map<string, string>();\n\n if ($$.injection.mode === \"inject\") {\n // Generate per-schema imports\n for (const [schemaName, injection] of $$.injection.perSchema) {\n const adapterAlias = `adapter_${schemaName}`;\n const scalarAlias = `scalar_${schemaName}`;\n adapterAliases.set(schemaName, adapterAlias);\n scalarAliases.set(schemaName, scalarAlias);\n\n imports.push(`import { adapter as ${adapterAlias} } from \"${injection.adapterImportPath}\";`);\n imports.push(`import { scalar as ${scalarAlias} } from \"${injection.scalarImportPath}\";`);\n }\n }\n\n const extraImports = imports.length > 0 ? `${imports.join(\"\\n\")}\\n` : \"\";\n\n // Generate per-schema definitions\n const schemaBlocks: string[] = [];\n const gqlEntries: string[] = [];\n\n for (const [name, config] of Object.entries($$.schemas)) {\n const schemaVar = `${name}Schema`;\n const adapterVar = $$.injection.mode === \"inject\" ? adapterAliases.get(name) : `adapter_${name}`;\n const scalarBlock = $$.injection.mode === \"inject\" ? scalarAliases.get(name) : config.scalarBlock;\n\n // Generate adapter if inline mode\n const adapterDefinition =\n $$.injection.mode === \"inject\"\n ? \"\"\n : `const ${adapterVar} = createRuntimeAdapter(({ type }) => ({\\n nonGraphqlErrorType: type<{ type: \"non-graphql-error\"; cause: unknown }>(),\\n}));\\n`;\n\n schemaBlocks.push(`${adapterDefinition}\nconst ${schemaVar} = {\n operations: defineOperationRoots({\n query: \"${config.queryType}\",\n mutation: \"${config.mutationType}\",\n subscription: \"${config.subscriptionType}\",\n }),\n scalar: ${scalarBlock},\n enum: ${config.enumBlock},\n input: ${config.inputBlock},\n object: ${config.objectBlock},\n union: ${config.unionBlock},\n} satisfies AnyGraphqlSchema;\n\nexport type Schema_${name} = typeof ${schemaVar} & { _?: never };\nexport type Adapter_${name} = typeof ${adapterVar} & { _?: never };`);\n\n gqlEntries.push(` ${name}: createGqlElementComposer<Schema_${name}, Adapter_${name}>(${schemaVar})`);\n }\n\n // Include createRuntimeAdapter import only in inline mode\n const runtimeImport = $$.injection.mode === \"inline\" ? '\\nimport { createRuntimeAdapter } from \"@soda-gql/runtime\";' : \"\";\n\n return `\\\nimport {\n type AnyGraphqlSchema,\n createGqlElementComposer,\n define,\n defineOperationRoots,\n unsafeInputType,\n unsafeOutputType,\n} from \"@soda-gql/core\";${runtimeImport}\n${extraImports}\n${schemaBlocks.join(\"\\n\")}\n\nexport const gql = {\n${gqlEntries.join(\",\\n\")}\n};\n`;\n};\n\nexport const generateMultiSchemaModule = (\n schemas: Map<string, DocumentNode>,\n options?: RuntimeGenerationOptions,\n): GeneratedModule => {\n // biome-ignore lint/suspicious/noExplicitAny: complex schema config type\n const schemaConfigs: Record<string, any> = {};\n const allStats = {\n objects: 0,\n enums: 0,\n inputs: 0,\n unions: 0,\n };\n\n for (const [name, document] of schemas.entries()) {\n const schema = createSchemaIndex(document);\n\n const builtinScalarDefinitions = Array.from(builtinScalarTypes.keys()).map((name) =>\n renderScalarDefinition(schema.scalars.get(name) ?? { name, directives: [] }),\n );\n\n const customScalarDefinitions = collectScalarNames(schema)\n .filter((name) => !builtinScalarTypes.has(name))\n .map((name) => {\n const record = schema.scalars.get(name);\n return record ? renderScalarDefinition(record) : \"\";\n })\n .filter((definition) => definition.length > 0);\n\n const allScalarDefinitions = builtinScalarDefinitions.concat(customScalarDefinitions);\n\n const objectTypeNames = collectObjectTypeNames(schema);\n const enumTypeNames = collectEnumTypeNames(schema);\n const inputTypeNames = collectInputTypeNames(schema);\n const unionTypeNames = collectUnionTypeNames(schema);\n\n const scalarBlock = renderPropertyLines({ entries: allScalarDefinitions, indentSize: 4 });\n const enumDefinitions = enumTypeNames\n .map((name) => renderEnumDefinition(schema, name))\n .filter((definition) => definition.length > 0);\n const enumBlock = renderPropertyLines({ entries: enumDefinitions, indentSize: 4 });\n const inputDefinitions = inputTypeNames\n .map((name) => renderInputDefinition(schema, name))\n .filter((definition) => definition.length > 0);\n const inputBlock = renderPropertyLines({ entries: inputDefinitions, indentSize: 4 });\n const objectDefinitions = objectTypeNames\n .map((name) => renderObjectDefinition(schema, name))\n .filter((definition) => definition.length > 0);\n const objectBlock = renderPropertyLines({ entries: objectDefinitions, indentSize: 4 });\n const unionDefinitions = unionTypeNames\n .map((name) => renderUnionDefinition(schema, name))\n .filter((definition) => definition.length > 0);\n const unionBlock = renderPropertyLines({ entries: unionDefinitions, indentSize: 4 });\n\n const queryType = schema.operationTypes.query ?? \"Query\";\n const mutationType = schema.operationTypes.mutation ?? \"Mutation\";\n const subscriptionType = schema.operationTypes.subscription ?? \"Subscription\";\n\n schemaConfigs[name] = {\n queryType,\n mutationType,\n subscriptionType,\n scalarBlock,\n enumBlock,\n inputBlock,\n objectBlock,\n unionBlock,\n };\n\n // Accumulate stats\n allStats.objects += objectDefinitions.length;\n allStats.enums += enumDefinitions.length;\n allStats.inputs += inputDefinitions.length;\n allStats.unions += unionDefinitions.length;\n }\n\n const injection: RuntimeTemplateInjection = options?.injection\n ? { mode: \"inject\", perSchema: options.injection }\n : { mode: \"inline\" };\n\n const code = multiRuntimeTemplate({\n schemas: schemaConfigs,\n injection,\n });\n\n return {\n code,\n stats: allStats,\n };\n};\n"],"mappings":";;;AAe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SAAS,EAAE;EAChD,MAAM,aAAa,oBAAoB;GAAE,SAAS;GAAkB,YAAY;GAAG,CAAC;EAEpF,MAAM,YAAY,OAAO,eAAe,SAAS;EACjD,MAAM,eAAe,OAAO,eAAe,YAAY;EACvD,MAAM,mBAAmB,OAAO,eAAe,gBAAgB;AAE/D,gBAAc,QAAQ;GACpB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;AAGD,WAAS,WAAW,kBAAkB;AACtC,WAAS,SAAS,gBAAgB;AAClC,WAAS,UAAU,iBAAiB;AACpC,WAAS,UAAU,iBAAiB;;CAGtC,MAAMC,YAAsC,SAAS,YACjD;EAAE,MAAM;EAAU,WAAW,QAAQ;EAAW,GAChD,EAAE,MAAM,UAAU;CAEtB,MAAM,OAAO,qBAAqB;EAChC,SAAS;EACT;EACD,CAAC;AAEF,QAAO;EACL;EACA,OAAO;EACR"}
@@ -0,0 +1,3 @@
1
+ import { createSchemaIndex, generateMultiSchemaModule } from "./generator-BgvqYNQA.js";
2
+
3
+ export { createSchemaIndex, generateMultiSchemaModule };
@@ -0,0 +1,4 @@
1
+ const require_generator = require('./generator-t_NByvnv.cjs');
2
+
3
+ exports.createSchemaIndex = require_generator.createSchemaIndex;
4
+ exports.generateMultiSchemaModule = require_generator.generateMultiSchemaModule;