diff --git a/src/Config/RuntimeConfig.cs b/src/Config/RuntimeConfig.cs index 8ecb513468..2afc1dfa9b 100644 --- a/src/Config/RuntimeConfig.cs +++ b/src/Config/RuntimeConfig.cs @@ -126,7 +126,7 @@ public void DetermineGraphQLEntityNames() /// This is used for looking up top-level entity name with GraphQL type, GraphQL type is not matching any of the top level entity name. /// Use singular field to find the top level entity name, then do the look up from the entities dictionary /// - public void MapGraphQLSingularTypeToEntityName() + public void MapGraphQLSingularTypeToEntityName(ILogger? logger) { foreach (KeyValuePair item in Entities) { @@ -141,6 +141,8 @@ public void MapGraphQLSingularTypeToEntityName() if (graphQL is null || graphQL.Type is null || (graphQL.Type is not SingularPlural && graphQL.Type is not string)) { + // Use entity name since GraphQL type unavailable + logger?.LogInformation($"GraphQL type for {entityName} is {entityName}"); continue; } @@ -149,8 +151,17 @@ public void MapGraphQLSingularTypeToEntityName() if (graphQLType is not null) { GraphQLSingularTypeToEntityNameMap.TryAdd(graphQLType, entityName); + // We have the GraphQL type so we log that + logger?.LogInformation($"GraphQL type for {entityName} is {graphQLType}"); } } + + // Log every entity that is not disabled for GQL + if (entity.GraphQL is null || entity.GraphQL is true) + { + // Use entity name since GraphQL type unavailable + logger?.LogInformation($"GraphQL type for {entityName} is {entityName}"); + } } } diff --git a/src/Service/Configurations/RuntimeConfigProvider.cs b/src/Service/Configurations/RuntimeConfigProvider.cs index daf728d86a..d95b0a7fef 100644 --- a/src/Service/Configurations/RuntimeConfigProvider.cs +++ b/src/Service/Configurations/RuntimeConfigProvider.cs @@ -131,7 +131,7 @@ public static bool LoadRuntimeConfigValue( out runtimeConfig, ConfigProviderLogger)) { - runtimeConfig!.MapGraphQLSingularTypeToEntityName(); + runtimeConfig!.MapGraphQLSingularTypeToEntityName(ConfigProviderLogger); if (!string.IsNullOrWhiteSpace(configPath?.CONNSTRING)) { runtimeConfig!.ConnectionString = configPath.CONNSTRING; @@ -238,7 +238,7 @@ public void Initialize( ConfigProviderLogger!)) { RuntimeConfiguration = runtimeConfig; - RuntimeConfiguration!.MapGraphQLSingularTypeToEntityName(); + RuntimeConfiguration!.MapGraphQLSingularTypeToEntityName(ConfigProviderLogger); RuntimeConfiguration!.ConnectionString = connectionString; if (RuntimeConfiguration!.DatabaseType == DatabaseType.cosmos)