From 64ad05dc92395712ebb2e41cbbe7071e1e22f461 Mon Sep 17 00:00:00 2001 From: Mikhail Shabanov Date: Thu, 2 Sep 2021 09:32:47 +0200 Subject: [PATCH] feat: mutation metadatada added --- ...litzStatisticsProClient.StrawberryShake.cs | 24 ++++-- ...litzStatisticsProClient.StrawberryShake.cs | 20 +++++ ...litzStatisticsProClient.StrawberryShake.cs | 14 ++++ ...litzStatisticsProClient.StrawberryShake.cs | 6 +- ...litzStatisticsProClient.StrawberryShake.cs | 83 +++++++++++++++++++ ...litzStatisticsProClient.StrawberryShake.cs | 36 ++++++++ ...litzStatisticsProClient.StrawberryShake.cs | 30 +++++++ ...litzStatisticsProClient.StrawberryShake.cs | 76 +++++++++++++++++ ...litzStatisticsProClient.StrawberryShake.cs | 34 ++++++++ ...litzStatisticsProClient.StrawberryShake.cs | 69 +++++++++++++++ ...litzStatisticsProClient.StrawberryShake.cs | 11 ++- .../Pages/PlayerInfoLayoutBase.cs | 12 +-- WotBlitzStatisticsPro.Blazor/Program.cs | 4 +- .../Services/GraphQlBackendService.cs | 23 ++--- .../Services/IGraphQlBackendService.cs | 2 +- .../Mock/GraphQlBackendMockService.cs | 4 +- .../graphql/UpdatePlayerInfoMutation.graphql | 10 +++ 17 files changed, 422 insertions(+), 36 deletions(-) create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutationDocument.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs create mode 100644 WotBlitzStatisticsPro.Blazor/graphql/UpdatePlayerInfoMutation.graphql diff --git a/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs index a9e6d07..69c08f4 100644 --- a/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs +++ b/WotBlitzStatisticsPro.Blazor/Generated/DependencyInjection/WotBlitzStatisticsProClientServiceCollectionExtensions.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -15,9 +15,10 @@ namespace Microsoft.Extensions.DependencyInjection return new ClientServiceProvider(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(serviceCollection)); }); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::WotBlitzStatisticsPro.Blazor.GraphQl.State.WotBlitzStatisticsProClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); return new global::StrawberryShake.ClientBuilder("WotBlitzStatisticsProClient", services, serviceCollection); @@ -52,13 +53,6 @@ namespace Microsoft.Extensions.DependencyInjection global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.PlayerResultFactory>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.PlayerBuilder>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.FindClansResultFactory>(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); @@ -73,6 +67,20 @@ namespace Microsoft.Extensions.DependencyInjection global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.PlayerResultFactory>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.PlayerBuilder>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.UpdatePlayerResultFactory>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::WotBlitzStatisticsPro.Blazor.GraphQl.State.UpdatePlayerBuilder>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..7131ec5 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,20 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Represents the operation service of the UpdatePlayer GraphQL operation + /// + /// mutation UpdatePlayer($accountId: Long!, $realmType: RealmType!, $requestLanguage: RequestLanguage!) { + /// gatherAccountInformation(accountId: $accountId, realmType: $realmType, requestLanguage: $requestLanguage) + /// } + /// + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IUpdatePlayerMutation : global::StrawberryShake.IOperationRequestFactory + { + global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::System.Threading.CancellationToken cancellationToken = default); + global::System.IObservable> Watch(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::StrawberryShake.ExecutionStrategy? strategy = null); + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..485feb3 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/IUpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,14 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public interface IUpdatePlayerResult + { + /// + /// Gathers all account information + /// + public global::System.DateTimeOffset GatherAccountInformation { get; } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs index a12d0fa..4a43a5b 100644 --- a/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs +++ b/WotBlitzStatisticsPro.Blazor/Generated/IWotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -9,10 +9,12 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] public interface IWotBlitzStatisticsProClient { - global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery Player { get; } - global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery FindClans { get; } global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery FindPlayers { get; } + + global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery Player { get; } + + global::WotBlitzStatisticsPro.Blazor.GraphQl.IUpdatePlayerMutation UpdatePlayer { get; } } } diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..6bb5a73 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerBuilder.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,83 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class UpdatePlayerBuilder : global::StrawberryShake.IOperationResultBuilder + { + private readonly global::StrawberryShake.IEntityStore _entityStore; + private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer; + private readonly global::StrawberryShake.IOperationResultDataFactory _resultDataFactory; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _realmTypeParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _requestLanguageParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _longParser; + private readonly global::StrawberryShake.Serialization.ILeafValueParser _dateTimeParser; + public UpdatePlayerBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) + { + _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); + _idSerializer = idSerializer ?? throw new global::System.ArgumentNullException(nameof(idSerializer)); + _resultDataFactory = resultDataFactory ?? throw new global::System.ArgumentNullException(nameof(resultDataFactory)); + _realmTypeParser = serializerResolver.GetLeafValueParser("RealmType") ?? throw new global::System.ArgumentException("No serializer for type `RealmType` found."); + _requestLanguageParser = serializerResolver.GetLeafValueParser("RequestLanguage") ?? throw new global::System.ArgumentException("No serializer for type `RequestLanguage` found."); + _longParser = serializerResolver.GetLeafValueParser("Long") ?? throw new global::System.ArgumentException("No serializer for type `Long` found."); + _dateTimeParser = serializerResolver.GetLeafValueParser("DateTime") ?? throw new global::System.ArgumentException("No serializer for type `DateTime` found."); + } + + public global::StrawberryShake.IOperationResult Build(global::StrawberryShake.Response response) + { + (IUpdatePlayerResult Result, UpdatePlayerResultInfo Info)? data = null; + global::System.Collections.Generic.IReadOnlyList? errors = null; + if (response.Exception is null) + { + try + { + if (response.Body != null) + { + if (response.Body.RootElement.TryGetProperty("data", out global::System.Text.Json.JsonElement dataElement) && dataElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + data = BuildData(dataElement); + } + + if (response.Body.RootElement.TryGetProperty("errors", out global::System.Text.Json.JsonElement errorsElement)) + { + errors = global::StrawberryShake.Json.JsonErrorParser.ParseErrors(errorsElement); + } + } + } + catch (global::System.Exception ex) + { + errors = new global::StrawberryShake.IClientError[]{new global::StrawberryShake.ClientError(ex.Message, exception: ex, extensions: new global::System.Collections.Generic.Dictionary{{"body", response.Body?.RootElement.ToString()}})}; + } + } + else + { + errors = new global::StrawberryShake.IClientError[]{new global::StrawberryShake.ClientError(response.Exception.Message, exception: response.Exception, extensions: new global::System.Collections.Generic.Dictionary{{"body", response.Body?.RootElement.ToString()}})}; + } + + return new global::StrawberryShake.OperationResult(data?.Result, data?.Info, _resultDataFactory, errors); + } + + private (IUpdatePlayerResult, UpdatePlayerResultInfo) BuildData(global::System.Text.Json.JsonElement obj) + { + var entityIds = new global::System.Collections.Generic.HashSet(); + global::StrawberryShake.IEntityStoreSnapshot snapshot = default !; + _entityStore.Update(session => + { + snapshot = session.CurrentSnapshot; + }); + var resultInfo = new UpdatePlayerResultInfo(DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "gatherAccountInformation")), entityIds, snapshot.Version); + return (_resultDataFactory.Create(resultInfo), resultInfo); + } + + private global::System.DateTimeOffset DeserializeNonNullableDateTimeOffset(global::System.Text.Json.JsonElement? obj) + { + if (!obj.HasValue) + { + throw new global::System.ArgumentNullException(); + } + + return _dateTimeParser.Parse(obj.Value.GetString()!); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..ab56a52 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultFactory.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,36 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class UpdatePlayerResultFactory : global::StrawberryShake.IOperationResultDataFactory + { + private readonly global::StrawberryShake.IEntityStore _entityStore; + public UpdatePlayerResultFactory(global::StrawberryShake.IEntityStore entityStore) + { + _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); + } + + global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::WotBlitzStatisticsPro.Blazor.GraphQl.IUpdatePlayerResult); + public UpdatePlayerResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) + { + if (snapshot is null) + { + snapshot = _entityStore.CurrentSnapshot; + } + + if (dataInfo is UpdatePlayerResultInfo info) + { + return new UpdatePlayerResult(info.GatherAccountInformation); + } + + throw new global::System.ArgumentException("UpdatePlayerResultInfo expected."); + } + + global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot) + { + return Create(dataInfo, snapshot); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..e2f6126 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/State/UpdatePlayerResultInfo.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,30 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl.State +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class UpdatePlayerResultInfo : global::StrawberryShake.IOperationResultDataInfo + { + private readonly global::System.Collections.Generic.IReadOnlyCollection _entityIds; + private readonly global::System.UInt64 _version; + public UpdatePlayerResultInfo(global::System.DateTimeOffset gatherAccountInformation, global::System.Collections.Generic.IReadOnlyCollection entityIds, global::System.UInt64 version) + { + GatherAccountInformation = gatherAccountInformation; + _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds)); + _version = version; + } + + /// + /// Gathers all account information + /// + public global::System.DateTimeOffset GatherAccountInformation { get; } + + public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; + public global::System.UInt64 Version => _version; + public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version) + { + return new UpdatePlayerResultInfo(GatherAccountInformation, _entityIds, version); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..9708820 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutation.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,76 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Represents the operation service of the UpdatePlayer GraphQL operation + /// + /// mutation UpdatePlayer($accountId: Long!, $realmType: RealmType!, $requestLanguage: RequestLanguage!) { + /// gatherAccountInformation(accountId: $accountId, realmType: $realmType, requestLanguage: $requestLanguage) + /// } + /// + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class UpdatePlayerMutation : global::WotBlitzStatisticsPro.Blazor.GraphQl.IUpdatePlayerMutation + { + private readonly global::StrawberryShake.IOperationExecutor _operationExecutor; + private readonly global::StrawberryShake.Serialization.IInputValueFormatter _longFormatter; + private readonly global::StrawberryShake.Serialization.IInputValueFormatter _realmTypeFormatter; + private readonly global::StrawberryShake.Serialization.IInputValueFormatter _requestLanguageFormatter; + public UpdatePlayerMutation(global::StrawberryShake.IOperationExecutor operationExecutor, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) + { + _operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor)); + _longFormatter = serializerResolver.GetInputValueFormatter("Long"); + _realmTypeFormatter = serializerResolver.GetInputValueFormatter("RealmType"); + _requestLanguageFormatter = serializerResolver.GetInputValueFormatter("RequestLanguage"); + } + + global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IUpdatePlayerResult); + public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::System.Threading.CancellationToken cancellationToken = default) + { + var request = CreateRequest(accountId, realmType, requestLanguage); + return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + + public global::System.IObservable> Watch(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage, global::StrawberryShake.ExecutionStrategy? strategy = null) + { + var request = CreateRequest(accountId, realmType, requestLanguage); + return _operationExecutor.Watch(request, strategy); + } + + private global::StrawberryShake.OperationRequest CreateRequest(global::System.Int64 accountId, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage requestLanguage) + { + var variables = new global::System.Collections.Generic.Dictionary(); + variables.Add("accountId", FormatAccountId(accountId)); + variables.Add("realmType", FormatRealmType(realmType)); + variables.Add("requestLanguage", FormatRequestLanguage(requestLanguage)); + return CreateRequest(variables); + } + + private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary? variables) + { + return new global::StrawberryShake.OperationRequest(id: UpdatePlayerMutationDocument.Instance.Hash.Value, name: "UpdatePlayer", document: UpdatePlayerMutationDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default, variables: variables); + } + + private global::System.Object? FormatAccountId(global::System.Int64 value) + { + return _longFormatter.Format(value); + } + + private global::System.Object? FormatRealmType(global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType value) + { + return _realmTypeFormatter.Format(value); + } + + private global::System.Object? FormatRequestLanguage(global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage value) + { + return _requestLanguageFormatter.Format(value); + } + + global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary? variables) + { + return CreateRequest(variables!); + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutationDocument.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutationDocument.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..a6b9679 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerMutationDocument.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,34 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + /// + /// Represents the operation service of the UpdatePlayer GraphQL operation + /// + /// mutation UpdatePlayer($accountId: Long!, $realmType: RealmType!, $requestLanguage: RequestLanguage!) { + /// gatherAccountInformation(accountId: $accountId, realmType: $realmType, requestLanguage: $requestLanguage) + /// } + /// + /// + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class UpdatePlayerMutationDocument : global::StrawberryShake.IDocument + { + private UpdatePlayerMutationDocument() + { + } + + public static UpdatePlayerMutationDocument Instance { get; } = new UpdatePlayerMutationDocument(); + public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Mutation; + public global::System.ReadOnlySpan Body => new global::System.Byte[]{0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x28, 0x24, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x20, 0x4c, 0x6f, 0x6e, 0x67, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x21, 0x2c, 0x20, 0x24, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x21, 0x29, 0x20, 0x7b, 0x20, 0x67, 0x61, 0x74, 0x68, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x3a, 0x20, 0x24, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x24, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x29, 0x20, 0x7d}; + public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("md5Hash", "8867fe2775ba9b1603c64f232456af15"); + public override global::System.String ToString() + { +#if NETSTANDARD2_0 + return global::System.Text.Encoding.UTF8.GetString(Body.ToArray()); +#else + return global::System.Text.Encoding.UTF8.GetString(Body); +#endif + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs new file mode 100644 index 0000000..1009a09 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/Generated/UpdatePlayerResult.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -0,0 +1,69 @@ +// +#nullable enable + +namespace WotBlitzStatisticsPro.Blazor.GraphQl +{ + [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] + public partial class UpdatePlayerResult : global::System.IEquatable, IUpdatePlayerResult + { + public UpdatePlayerResult(global::System.DateTimeOffset gatherAccountInformation) + { + GatherAccountInformation = gatherAccountInformation; + } + + /// + /// Gathers all account information + /// + public global::System.DateTimeOffset GatherAccountInformation { get; } + + public virtual global::System.Boolean Equals(UpdatePlayerResult? other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + if (ReferenceEquals(this, other)) + { + return true; + } + + if (other.GetType() != GetType()) + { + return false; + } + + return (GatherAccountInformation.Equals(other.GatherAccountInformation)); + } + + public override global::System.Boolean Equals(global::System.Object? obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return Equals((UpdatePlayerResult)obj); + } + + public override global::System.Int32 GetHashCode() + { + unchecked + { + int hash = 5; + hash ^= 397 * GatherAccountInformation.GetHashCode(); + return hash; + } + } + } +} diff --git a/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs b/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs index f9487f5..3b28d13 100644 --- a/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs +++ b/WotBlitzStatisticsPro.Blazor/Generated/WotBlitzStatisticsProClient.WotBlitzStatisticsProClient.StrawberryShake.cs @@ -9,19 +9,22 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")] public partial class WotBlitzStatisticsProClient : global::WotBlitzStatisticsPro.Blazor.GraphQl.IWotBlitzStatisticsProClient { - private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery _player; private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery _findClans; private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery _findPlayers; - public WotBlitzStatisticsProClient(global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery player, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery findClans, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery findPlayers) + private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery _player; + private readonly global::WotBlitzStatisticsPro.Blazor.GraphQl.IUpdatePlayerMutation _updatePlayer; + public WotBlitzStatisticsProClient(global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery findClans, global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery findPlayers, global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery player, global::WotBlitzStatisticsPro.Blazor.GraphQl.IUpdatePlayerMutation updatePlayer) { - _player = player ?? throw new global::System.ArgumentNullException(nameof(player)); _findClans = findClans ?? throw new global::System.ArgumentNullException(nameof(findClans)); _findPlayers = findPlayers ?? throw new global::System.ArgumentNullException(nameof(findPlayers)); + _player = player ?? throw new global::System.ArgumentNullException(nameof(player)); + _updatePlayer = updatePlayer ?? throw new global::System.ArgumentNullException(nameof(updatePlayer)); } public static global::System.String ClientName => "WotBlitzStatisticsProClient"; - public global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery Player => _player; public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery FindClans => _findClans; public global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindPlayersQuery FindPlayers => _findPlayers; + public global::WotBlitzStatisticsPro.Blazor.GraphQl.IPlayerQuery Player => _player; + public global::WotBlitzStatisticsPro.Blazor.GraphQl.IUpdatePlayerMutation UpdatePlayer => _updatePlayer; } } diff --git a/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoLayoutBase.cs b/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoLayoutBase.cs index 4945508..abeac71 100644 --- a/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoLayoutBase.cs +++ b/WotBlitzStatisticsPro.Blazor/Pages/PlayerInfoLayoutBase.cs @@ -34,14 +34,14 @@ namespace WotBlitzStatisticsPro.Blazor.Pages var loggedInInfo = await LocalStorageService.GetItemAsync(Constants.LoginInfoLocalStorageKey); var settings = await LocalStorageService.ReadSettings(); CurrentRealmType = settings.RealmType; - if(loggedInInfo == null) + + // Maybe add refresh button instead of calling mutation each time + if(loggedInInfo != null && loggedInInfo.AccountId == AccountId) { - (AccountInfo, AchievementsBySection) = await GraphQlBackendService.GetPlayerInfo(AccountId, CurrentRealmType); - } - else - { - (AccountInfo, AchievementsBySection) = await GraphQlBackendService.CollectPlayerInfo(AccountId, CurrentRealmType, loggedInInfo.AccessToken); + await GraphQlBackendService.CollectPlayerInfo(AccountId, CurrentRealmType, loggedInInfo.AccessToken); } + + (AccountInfo, AchievementsBySection) = await GraphQlBackendService.GetPlayerInfo(AccountId, CurrentRealmType); } } } \ No newline at end of file diff --git a/WotBlitzStatisticsPro.Blazor/Program.cs b/WotBlitzStatisticsPro.Blazor/Program.cs index 7d00a9c..d17de1c 100644 --- a/WotBlitzStatisticsPro.Blazor/Program.cs +++ b/WotBlitzStatisticsPro.Blazor/Program.cs @@ -45,11 +45,11 @@ namespace WotBlitzStatisticsPro.Blazor //var useMock = Environment.GetEnvironmentVariable("USE_GRAPH_QL_MOCK"); //if (useMock != null && useMock == "true") //{ - builder.Services.AddTransient(); + //builder.Services.AddTransient(); //} //else //{ - //builder.Services.AddTransient(); + builder.Services.AddTransient(); //} var host = builder.Build(); diff --git a/WotBlitzStatisticsPro.Blazor/Services/GraphQlBackendService.cs b/WotBlitzStatisticsPro.Blazor/Services/GraphQlBackendService.cs index 315dde2..7453e72 100644 --- a/WotBlitzStatisticsPro.Blazor/Services/GraphQlBackendService.cs +++ b/WotBlitzStatisticsPro.Blazor/Services/GraphQlBackendService.cs @@ -52,6 +52,18 @@ namespace WotBlitzStatisticsPro.Blazor.Services throw new System.NotImplementedException("Request for LoginUrl will be implemented soon"); } + public Task ProlongToken(long accountId, string oldToken, RealmType realmType) + { + throw new System.NotImplementedException(); + } + + public Task CollectPlayerInfo(long accountId, RealmType realmType, string accessToken) + { + // ToDo: Call mutation with accessToken in the context + + return _client.UpdatePlayer.ExecuteAsync(accountId, realmType, RequestLanguage.En); + } + private RequestLanguage GetLanguage() { var culture = CultureInfo.CurrentCulture; @@ -100,16 +112,5 @@ namespace WotBlitzStatisticsPro.Blazor.Services _notificationsService.ReportError("Backend error",string.Join(";", messages)); } } - - public Task ProlongToken(long accountId, string oldToken, RealmType realmType) - { - throw new System.NotImplementedException(); - } - - public Task<(IAccount accountInfo, IReadOnlyList achievementsBySection)> CollectPlayerInfo(long accountId, RealmType realmType, string accessToken) - { - // ToDo: Call mutation with accessToken in the context - throw new System.NotImplementedException(); - } } } \ No newline at end of file diff --git a/WotBlitzStatisticsPro.Blazor/Services/IGraphQlBackendService.cs b/WotBlitzStatisticsPro.Blazor/Services/IGraphQlBackendService.cs index 93387ca..e20f045 100644 --- a/WotBlitzStatisticsPro.Blazor/Services/IGraphQlBackendService.cs +++ b/WotBlitzStatisticsPro.Blazor/Services/IGraphQlBackendService.cs @@ -19,7 +19,7 @@ namespace WotBlitzStatisticsPro.Blazor.Services long accountId, RealmType realmType); - Task<(IAccount accountInfo, IReadOnlyList achievementsBySection)> CollectPlayerInfo( + Task CollectPlayerInfo( long accountId, RealmType realmType, string accessToken); diff --git a/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs b/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs index 22682e7..e0ecef3 100644 --- a/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs +++ b/WotBlitzStatisticsPro.Blazor/Services/Mock/GraphQlBackendMockService.cs @@ -394,9 +394,9 @@ namespace WotBlitzStatisticsPro.Blazor.Services.Mock return Task.FromResult(new LoginInfo { AccountId = accountId, AccessToken = oldToken, Realm = realmType, ExpiresAt = 1631182800, NickName = "Fake nick"}); } - public Task<(IAccount accountInfo, IReadOnlyList achievementsBySection)> CollectPlayerInfo(long accountId, RealmType realmType, string accessToken) + public Task CollectPlayerInfo(long accountId, RealmType realmType, string accessToken) { - return GetPlayerInfo(accountId, realmType); + return Task.CompletedTask; } } } \ No newline at end of file diff --git a/WotBlitzStatisticsPro.Blazor/graphql/UpdatePlayerInfoMutation.graphql b/WotBlitzStatisticsPro.Blazor/graphql/UpdatePlayerInfoMutation.graphql new file mode 100644 index 0000000..cba0264 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/graphql/UpdatePlayerInfoMutation.graphql @@ -0,0 +1,10 @@ +mutation updatePlayer ( + $accountId: Long!, + $realmType: RealmType!, + $requestLanguage: RequestLanguage!) +{ + gatherAccountInformation( + accountId: $accountId, + realmType: $realmType, + requestLanguage: $requestLanguage) +} \ No newline at end of file