27 lines
654 B
C#
27 lines
654 B
C#
using FictionArchive.Service.ReportingService.Models;
|
|
using FictionArchive.Service.ReportingService.Services;
|
|
using HotChocolate.Authorization;
|
|
using HotChocolate.Data;
|
|
|
|
namespace FictionArchive.Service.ReportingService.GraphQL;
|
|
|
|
[QueryType]
|
|
public static class JobQueries
|
|
{
|
|
[UseProjection]
|
|
[Authorize]
|
|
[UseFirstOrDefault]
|
|
public static IQueryable<Job> GetJobById(
|
|
Guid jobId,
|
|
ReportingDbContext db)
|
|
=> db.Jobs.Where(j => j.Id == jobId);
|
|
|
|
[UsePaging]
|
|
[UseProjection]
|
|
[UseFiltering]
|
|
[UseSorting]
|
|
[Authorize]
|
|
public static IQueryable<Job> GetJobs(ReportingDbContext db)
|
|
=> db.Jobs;
|
|
}
|