MCPcopy
hub / github.com/subquery/subql / generateSchemaModels

Function generateSchemaModels

packages/cli/src/controller/codegen-controller.ts:284–293  ·  view source on GitHub ↗
(projectPath: string, schemaPath: string)

Source from the content-addressed store, hash-verified

282}
283
284export async function generateSchemaModels(projectPath: string, schemaPath: string): Promise<void> {
285 const modelDir = path.join(projectPath, MODEL_ROOT_DIR);
286 const interfacesPath = path.join(projectPath, TYPE_ROOT_DIR, `interfaces.ts`);
287 await prepareDirPath(modelDir, true);
288 await prepareDirPath(interfacesPath, false);
289
290 await generateJsonInterfaces(projectPath, schemaPath);
291 await generateModels(projectPath, schemaPath);
292 await generateEnums(projectPath, schemaPath);
293}
294
295export function validateEntityName(name: string): string {
296 for (const reservedKey of RESERVED_KEYS) {

Callers 1

codegenFunction · 0.85

Calls 4

prepareDirPathFunction · 0.90
generateJsonInterfacesFunction · 0.85
generateModelsFunction · 0.85
generateEnumsFunction · 0.85

Tested by

no test coverage detected