diff --git a/src/Tgstation.Server.Host/GraphQL/Types/UserGroup.cs b/src/Tgstation.Server.Host/GraphQL/Types/UserGroup.cs index b555f203e0..c9c5fcede2 100644 --- a/src/Tgstation.Server.Host/GraphQL/Types/UserGroup.cs +++ b/src/Tgstation.Server.Host/GraphQL/Types/UserGroup.cs @@ -1,8 +1,11 @@ using System; +using System.Linq; using System.Threading; using System.Threading.Tasks; using HotChocolate; +using HotChocolate.Data; +using HotChocolate.Types; using HotChocolate.Types.Relay; using Tgstation.Server.Host.Authority; @@ -50,5 +53,25 @@ namespace Tgstation.Server.Host.GraphQL.Types return (await permissionSetAuthority.InvokeTransformable( authority => authority.GetId(Id, PermissionSetLookupType.GroupId, cancellationToken)))!; } + + /// + /// Queries all registered s in the . + /// + /// The . + /// A of all registered s in the indicated by . + [UsePaging] + [UseFiltering] + [UseSorting] + [TgsGraphQLAuthorize(nameof(IUserAuthority.Queryable))] + public IQueryable QueryableUsersByGroup( + [Service] IGraphQLAuthorityInvoker userAuthority) + { + ArgumentNullException.ThrowIfNull(userAuthority); + var dtoQueryable = userAuthority.InvokeTransformableQueryable( + authority => authority + .Queryable(false) + .Where(user => user.GroupId == Id)); + return dtoQueryable; + } } }