in src/Epam.GraphQL/Configuration/RelationRegistry.cs [397:437]
public string GetGraphQLAutoTypeName(Type type, bool isInput)
{
var prefix = string.Empty;
if (_projectionEntityTypes.Contains(type))
{
prefix = "Auto";
}
var name = $"{prefix}{type.GraphQLTypeName(isInput)}";
if (!IsTypeNameRegistered(name))
{
RegisterProjectionType(name, type, null);
return name;
}
if (TryGetRegisteredType(name, out var existingType))
{
if (existingType.Entity == type)
{
return name;
}
}
var counter = 1;
while (IsTypeNameRegistered($"{name}{counter}"))
{
if (TryGetRegisteredType($"{name}{counter}", out existingType) && existingType.Entity == type)
{
return $"{name}{counter}";
}
counter++;
}
name = $"{name}{counter}";
RegisterProjectionType(name, type, null);
return name;
}