diff --git a/packages/cli/src/commands/generate-schema.ts b/packages/cli/src/commands/generate-schema.ts index d4e0b5e..b63693c 100644 --- a/packages/cli/src/commands/generate-schema.ts +++ b/packages/cli/src/commands/generate-schema.ts @@ -18,26 +18,19 @@ export const generateSchemaAction = async ({ const demoConfig = require(configPath).default; console.log(demoConfig); - // const validatedConfig = validateConfig(demoConfig); + const validatedConfig = validateConfig(demoConfig); - // if (!validatedConfig) { - // throw new Error("Invalid config"); - // } + if (!validatedConfig) { + throw new Error("Invalid config"); + } - // const schemas = [ - // { - // id: "mgt", - // uri: "https://mgt.auth.dog/graphql", - // }, - // { - // id: "authz", - // uri: "https://authz.auth.dog/graphql", - // }, - // ]; - - // await buildSchemaIntrospection(schemas, outputPath); + try { + await buildSchemaIntrospection(validatedConfig.schemas, outputPath); + } + catch (error) { + console.error(error); + } - - // console.log("Generate Schema action"); + console.info("Schema generated successfully"); } \ No newline at end of file