From ebea86846fd6606ab90963806339b93895061cd6 Mon Sep 17 00:00:00 2001 From: Diluka Date: Mon, 7 Apr 2025 14:20:06 +0800 Subject: [PATCH] Update graphql-config.ts Finally, check the default, otherwise the judgment function will be exited in advance. --- packages/graphql-codegen-cli/src/graphql-config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/graphql-codegen-cli/src/graphql-config.ts b/packages/graphql-codegen-cli/src/graphql-config.ts index 8662ba922da..8c8c63df57a 100644 --- a/packages/graphql-codegen-cli/src/graphql-config.ts +++ b/packages/graphql-codegen-cli/src/graphql-config.ts @@ -55,10 +55,6 @@ function isGraphQLConfig(config: GraphQLConfig): config is GraphQLConfig { return false; } - try { - return config.getDefault().hasExtension('codegen'); - } catch {} - try { for (const projectName in config.projects) { if (Object.prototype.hasOwnProperty.call(config.projects, projectName)) { @@ -71,5 +67,9 @@ function isGraphQLConfig(config: GraphQLConfig): config is GraphQLConfig { } } catch {} + try { + return config.getDefault().hasExtension('codegen'); + } catch {} + return false; }