diff --git a/src/Tgstation.Server.Host/GraphQL/Transformers/UpdatedUserTransformer.cs b/src/Tgstation.Server.Host/GraphQL/Transformers/UpdatedUserTransformer.cs
index cceb5ea027..06a2216d4d 100644
--- a/src/Tgstation.Server.Host/GraphQL/Transformers/UpdatedUserTransformer.cs
+++ b/src/Tgstation.Server.Host/GraphQL/Transformers/UpdatedUserTransformer.cs
@@ -11,9 +11,14 @@ namespace Tgstation.Server.Host.GraphQL.Transformers
/// Initializes a new instance of the class.
///
public UpdatedUserTransformer()
- : base(model => model.User != null
- ? new UpdatedUser(model.User)
- : new UpdatedUser(model.Id))
+ : base(
+ BuildSubProjection(
+ (model, user) => new UpdatedUser
+ {
+ Id = model.Id,
+ User = user,
+ },
+ model => model.User))
{
}
}
diff --git a/src/Tgstation.Server.Host/GraphQL/Types/UpdatedUser.cs b/src/Tgstation.Server.Host/GraphQL/Types/UpdatedUser.cs
index 18652abcb6..bd36ea3c8d 100644
--- a/src/Tgstation.Server.Host/GraphQL/Types/UpdatedUser.cs
+++ b/src/Tgstation.Server.Host/GraphQL/Types/UpdatedUser.cs
@@ -1,9 +1,4 @@
-using System;
-
-using HotChocolate.Types.Relay;
-
-using Tgstation.Server.Host.GraphQL.Transformers;
-using Tgstation.Server.Host.Models;
+using HotChocolate.Types.Relay;
namespace Tgstation.Server.Host.GraphQL.Types
{
@@ -16,30 +11,11 @@ namespace Tgstation.Server.Host.GraphQL.Types
/// The 's .
///
[ID(nameof(Types.User))]
- public long Id { get; }
+ public required long Id { get; init; }
///
/// The , if was authorized to be read.
///
- public User? User { get; }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The value of containing the .
- public UpdatedUser(Models.User user)
- : this((user ?? throw new ArgumentNullException(nameof(user))).Require(u => u.Id))
- {
- User = ((IApiTransformable)user).ToApi();
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The value of .
- public UpdatedUser(long id)
- {
- Id = id;
- }
+ public required User? User { get; set; }
}
}