mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Some graphQL API refactor
This commit is contained in:
1 parent
c3550fbddd
commit
87fcdd31b1
8 files changed
+346
-175
No files matched your search
@@ -0,0 +1,14 @@
|
||||
using HotChocolate.Types;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.GraphQl.ObjectTypes
|
||||
{
|
||||
[ExtendObjectType(Name = "Query")]
|
||||
public class StatisticsResponseType: InterfaceType<IStatisticsResponse>
|
||||
{
|
||||
protected override void Configure(IInterfaceTypeDescriptor<IStatisticsResponse> descriptor)
|
||||
{
|
||||
descriptor.Name("Statistics");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using HotChocolate.Types;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.GraphQl.ObjectTypes
|
||||
{
|
||||
[ExtendObjectType(Name = "Query")]
|
||||
public class TankInfoResponseType: ObjectType<TankInfoResponse>
|
||||
{
|
||||
protected override void Configure(IObjectTypeDescriptor<TankInfoResponse> descriptor)
|
||||
{
|
||||
descriptor.Name("TankInfoResponse");
|
||||
descriptor.Implements<StatisticsResponseType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ namespace WotBlitzStatisticsPro.GraphQl
|
||||
.AddType<WotBlitzStatisticsQuery>()
|
||||
.AddType<AccountInfoResolver>()
|
||||
.AddType<WotBlitzAchievementsQuery>()
|
||||
.AddType<TankInfoResponseType>()
|
||||
.AddMutationType(d => d.Name("Mutation"))
|
||||
.AddType<WotBlitzStatisticsMutation>()
|
||||
.AddType<AuthenticationMutation>()
|
||||
|
||||
Reference in new issue
Block a user