initial commit

This commit is contained in:
Yui
2025-11-26 16:50:06 -03:00
commit 5644aa0ebf
47 changed files with 800 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
using Domain.Entities;
namespace GraphQLTEST.GraphQL.Types;
public class KillNode : ObjectType<Kill>
{
protected override void Configure(IObjectTypeDescriptor<Kill> descriptor)
{
descriptor.Ignore(x => x.Id);
descriptor.Ignore(x => x.UserId);
}
}

View File

@@ -0,0 +1,26 @@
using System.Security.Principal;
using Application.Interfaces.Services;
using Domain.Entities;
using GraphQLTEST.GraphQL.DataLoaders;
using GreenDonut.Data;
using HotChocolate.Types.Pagination;
namespace GraphQLTEST.GraphQL.Types;
public class UserNode : ObjectType<User>
{
protected override void Configure(IObjectTypeDescriptor<User> descriptor)
{
descriptor.Ignore(x => x.Id);
descriptor.Ignore(x => x.Password);
descriptor.Field(x => x.Kills)
.UsePaging()
.UseFiltering()
.ParentRequires<User>(x => nameof(x.Id))
.Resolve(async (r, t) =>
{
User parent = r.Parent<User>();
return await r.DataLoader<KillsByUserDataLoader>().LoadAsync(parent.Id, t);
});
}
}