Some graphQL API refactor

This commit is contained in:
Mikhail Shabanov committed 2021-06-04 14:13:16 +02:00
1 parent c3550fbddd
commit 87fcdd31b1
8 files changed
+346 -175

No files matched your search

@@ -1,5 +1,6 @@
using HotChocolate.Types;
using WotBlitzStatisticsPro.Common.Model;
using WotBlitzStatisticsPro.GraphQl.ObjectTypes;
using WotBlitzStatisticsPro.Logic;
namespace WotBlitzStatisticsPro.GraphQl.Resolvers
@@ -9,6 +10,9 @@ namespace WotBlitzStatisticsPro.GraphQl.Resolvers
{
protected override void Configure(IObjectTypeDescriptor<AccountInfoResponse> descriptor)
{
descriptor.Name("AccountInfoResponse");
descriptor.Implements<StatisticsResponseType>();
descriptor.Field(t => t.ClanInfo)
.Resolver(ctx => ctx.Service<IWargamingClans>().GelClanInfoByAccount(ctx.Parent<AccountInfoResponse>().AccountId, ctx.Parent<AccountInfoResponse>().RegionAndLanguage));
}