diff --git a/src/Tgstation.Server.Host/GraphQL/Transformers/UserTransformer.cs b/src/Tgstation.Server.Host/GraphQL/Transformers/UserTransformer.cs index 23109be9b9..c9a47f26d1 100644 --- a/src/Tgstation.Server.Host/GraphQL/Transformers/UserTransformer.cs +++ b/src/Tgstation.Server.Host/GraphQL/Transformers/UserTransformer.cs @@ -25,7 +25,7 @@ namespace Tgstation.Server.Host.GraphQL.Transformers { CreatedAt = model.CreatedAt ?? NotNullFallback(), CanonicalName = model.CanonicalName ?? NotNullFallback(), - CreatedById = model.CreatedById, + CreatedById = model.CreatedById ?? NotNullFallback(), Enabled = model.Enabled ?? NotNullFallback(), Id = model.Id!.Value, Name = model.Name ?? NotNullFallback(), diff --git a/src/Tgstation.Server.Host/GraphQL/Types/User.cs b/src/Tgstation.Server.Host/GraphQL/Types/User.cs index bef56638e7..8b6a08c5db 100644 --- a/src/Tgstation.Server.Host/GraphQL/Types/User.cs +++ b/src/Tgstation.Server.Host/GraphQL/Types/User.cs @@ -74,7 +74,7 @@ namespace Tgstation.Server.Host.GraphQL.Types /// The of the . /// [IsProjected(true)] - public required long? CreatedById { get; init; } + public required long CreatedById { get; init; } /// /// Implements the . @@ -131,15 +131,13 @@ namespace Tgstation.Server.Host.GraphQL.Types CancellationToken cancellationToken) { ArgumentNullException.ThrowIfNull(userAuthority); - if (!CreatedById.HasValue) - return null; // This one is particular and cannot be data-loaded due to necessitating a different parameter var user = await userAuthority.InvokeTransformable( - authority => authority.GetId(CreatedById.Value, true, cancellationToken), + authority => authority.GetId(CreatedById, true, cancellationToken), queryContext); if (user == null) - throw new InvalidOperationException($"Query for created by of user ID {CreatedById.Value} returned null!"); + throw new InvalidOperationException($"Query for created by of user ID {CreatedById} returned null!"); if (user.CanonicalName == Models.User.CanonicalizeName(Models.User.TgsSystemUserName)) return new UserName(user);