< Summary

Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 96
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetCurrentUser()100%11100%
GetCurrentUser()100%11100%

File(s)

/home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/obj/Debug/net10.0/generated/HotChocolate.Types.Analyzers/HotChocolate.Types.Analyzers.GraphQLServerGenerator/CurrentUserQueries.M6SmBChz_K6lfp_7b0aNFw.hc.g.cs

#LineLine coverage
 1// <auto-generated/>
 2
 3#nullable enable
 4#pragma warning disable
 5
 6using System;
 7using System.Runtime.CompilerServices;
 8using HotChocolate;
 9using HotChocolate.Types;
 10using HotChocolate.Execution.Configuration;
 11using Microsoft.Extensions.DependencyInjection;
 12using HotChocolate.Internal;
 13
 14namespace Api.Auth.Queries
 15{
 16    public partial class CurrentUserQueries
 17    {
 18        internal static void Initialize(global::HotChocolate.Types.IObjectTypeDescriptor descriptor)
 19        {
 20            var extension = descriptor.Extend();
 21            var configuration = extension.Configuration;
 22            var thisType = typeof(global::Api.Auth.Queries.CurrentUserQueries);
 23            var bindingResolver = extension.Context.ParameterBindingResolver;
 24            var resolvers = new __Resolvers();
 25
 26            HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
 27                extension.Context,
 28                descriptor,
 29                typeof(global::Api.Auth.Queries.CurrentUserQueries),
 30                new global::HotChocolate.Types.QueryTypeAttribute());
 31            configuration.ConfigurationsAreApplied = true;
 32
 33            var naming = descriptor.Extend().Context.Naming;
 34
 35            descriptor
 36                .Field(naming.GetMemberName("CurrentUser", global::HotChocolate.Types.MemberKind.ObjectField))
 37                .ExtendWith(static (field, context) =>
 38                {
 39                    var configuration = field.Configuration;
 40                    var typeInspector = field.Context.TypeInspector;
 41                    var bindingResolver = field.Context.ParameterBindingResolver;
 42                    var naming = field.Context.Naming;
 43
 44                    configuration.Type = global::HotChocolate.Types.Descriptors.TypeReference.Create(
 45                        typeInspector.GetTypeRef(typeof(global::Api.Auth.Queries.User), HotChocolate.Types.TypeContext.O
 46                        new global::HotChocolate.Language.NonNullTypeNode(new global::HotChocolate.Language.NamedTypeNod
 47                    configuration.ResultType = typeof(global::Api.Auth.Queries.User);
 48                    configuration.DeclaringType = context.ThisType;
 49
 50                    configuration.SetSourceGeneratorFlags();
 51
 52                    configuration.Member = context.ThisType.GetMethod(
 53                        "GetCurrentUser",
 54                        global::HotChocolate.Utilities.ReflectionUtils.StaticMemberFlags,
 55                        new global::System.Type[]
 56                        {
 57                            typeof(global::Api.Database.PGContext),
 58                            typeof(global::Api.Auth.Utils.ICurrentUserId),
 59                            typeof(global::System.Threading.CancellationToken)
 60                        })!;
 61
 62                    var fieldDescriptor = global::HotChocolate.Types.Descriptors.ObjectFieldDescriptor.From(field.Contex
 63                    HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
 64                        field.Context,
 65                        fieldDescriptor,
 66                        configuration.Member,
 67                        new global::Api.Auth.Handlers.PermissionCheckAuthorizeAttribute(global::Api.Auth.Models.UserPerm
 68                    configuration.ConfigurationsAreApplied = true;
 69                    fieldDescriptor.CreateConfiguration();
 70
 71                    configuration.Resolvers = context.Resolvers.GetCurrentUser();
 72                },
 73                (Resolvers: resolvers, ThisType: thisType));
 74
 75            Configure(descriptor);
 76        }
 77
 78        static partial void Configure(global::HotChocolate.Types.IObjectTypeDescriptor descriptor);
 79
 80        private sealed class __Resolvers
 81        {
 82            public HotChocolate.Resolvers.FieldResolverDelegates GetCurrentUser()
 183                => new global::HotChocolate.Resolvers.FieldResolverDelegates(resolver: GetCurrentUser);
 84
 85            private async global::System.Threading.Tasks.ValueTask<global::System.Object?> GetCurrentUser(global::HotCho
 186            {
 187                var args0 = context.Service<global::Api.Database.PGContext>();
 188                var args1 = context.Service<global::Api.Auth.Utils.ICurrentUserId>();
 189                var args2 = context.RequestAborted;
 190                var result = await global::Api.Auth.Queries.CurrentUserQueries.GetCurrentUser(args0, args1, args2);
 191                return result;
 192            }
 93        }
 94    }
 95}
 96

Methods/Properties

GetCurrentUser()
GetCurrentUser()