mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-12-05 07:42:34 +01:00
Some Data loader stuff
This commit is contained in:
1 parent
d643c323b3
commit
83628d21bd
5 files changed
+61
-14
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using HotChocolate;
|
||||
using WotBlitzStatistics.GraphQl.DataLoaders;
|
||||
using WotBlitzStatisticsPro.WgApiClient;
|
||||
using WotBlitzStatisticsPro.WgApiClient.Model;
|
||||
|
||||
namespace WotBlitzStatistics.GraphQl.Resolvers
|
||||
{
|
||||
[GraphQLResolverOf(typeof(ClanInfo))]
|
||||
public class ClanInfoResolver
|
||||
{
|
||||
public async Task<ClanInfo> GetClanInfo(
|
||||
[Parent] ClanAccountInfo clanAccountInfo,
|
||||
[DataLoader] ClanDataLoader clanDataLoader)
|
||||
{
|
||||
return (await clanDataLoader.LoadAsync(new[] {clanAccountInfo.ClanId.Value}, CancellationToken.None))[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user