mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Clan info added
This commit is contained in:
1 parent
1d13507aa7
commit
089c6329ee
7 files changed
+261
-1
No files matched your search
@@ -0,0 +1,10 @@
|
||||
using HotChocolate.Types;
|
||||
using WotBlitzStatisticsPro.WgApiClient.Model;
|
||||
|
||||
namespace WotBlitzStatistics.GraphQl.ObjectTypes
|
||||
{
|
||||
public class ClanInfoObjectType : ObjectType<ClanInfo>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ namespace WotBlitzStatistics.GraphQl.ObjectTypes
|
||||
protected override void Configure(IObjectTypeDescriptor<AccountInfo> descriptor)
|
||||
{
|
||||
descriptor.Field(a => a.Private).Ignore();
|
||||
descriptor.Field("clanInfo")
|
||||
descriptor.Field("accountClanInfo")
|
||||
//.Argument("accountId", a => a.Type<NonNullType<LongType>>())
|
||||
//.Type<ClanAccountInfo>()
|
||||
.Resolver(c => c.Service<IWargamingApiClient>()
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
using HotChocolate.Types;
|
||||
using WotBlitzStatisticsPro.WgApiClient;
|
||||
using WotBlitzStatisticsPro.WgApiClient.Model;
|
||||
|
||||
namespace WotBlitzStatistics.GraphQl.ObjectTypes
|
||||
{
|
||||
public class PlayerClanInfoObjectType : ObjectType<ClanAccountInfo>
|
||||
{
|
||||
protected override void Configure(IObjectTypeDescriptor<ClanAccountInfo> descriptor)
|
||||
{
|
||||
// ToDo: Cache clan info!
|
||||
// https://hotchocolate.io/docs/dataloaders
|
||||
descriptor.Field("clanInfo")
|
||||
.Resolver(c => c.Service<IWargamingApiClient>()
|
||||
.GetClanInfo(c.Parent<ClanAccountInfo>().ClanId.Value));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ namespace WotBlitzStatistics.GraphQl
|
||||
.AddType<AccountStatistics>()
|
||||
.AddType<AccountFullStatistics>()
|
||||
.AddType<PlayerClanInfoObjectType>()
|
||||
.AddType<ClanInfoObjectType>()
|
||||
//.AddEnumType<MarkOfMastery>()
|
||||
.Create());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user