Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/Config/RuntimeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// </summary>
public void MapGraphQLSingularTypeToEntityName()
public void MapGraphQLSingularTypeToEntityName(ILogger? logger)
{
foreach (KeyValuePair<string, Entity> item in Entities)
{
Expand All @@ -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;
}

Expand All @@ -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}");
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Service/Configurations/RuntimeConfigProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -238,7 +238,7 @@ public void Initialize(
ConfigProviderLogger!))
{
RuntimeConfiguration = runtimeConfig;
RuntimeConfiguration!.MapGraphQLSingularTypeToEntityName();
RuntimeConfiguration!.MapGraphQLSingularTypeToEntityName(ConfigProviderLogger);
RuntimeConfiguration!.ConnectionString = connectionString;

if (RuntimeConfiguration!.DatabaseType == DatabaseType.cosmos)
Expand Down