< Summary

Line coverage
50%
Covered lines: 10
Uncovered lines: 10
Coverable lines: 20
Total lines: 140
Line coverage: 50%
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
.ctor(...)100%11100%
CreateParameterDescriptor_AddTagAsync_input()100%11100%
AddTagAsync()100%11100%
AddTagAsync()100%210%

File(s)

/home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/obj/Debug/net10.0/generated/HotChocolate.Types.Analyzers/HotChocolate.Types.Analyzers.GraphQLServerGenerator/AddTagMutations.5K_PEMQ_7wff-4-lE1HACg.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.Works.Mutations
 15{
 16    public static partial class AddTagMutations
 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.Works.Mutations.AddTagMutations);
 23            var bindingResolver = extension.Context.ParameterBindingResolver;
 24            var resolvers = new __Resolvers(bindingResolver);
 25
 26            HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
 27                extension.Context,
 28                descriptor,
 29                typeof(global::Api.Works.Mutations.AddTagMutations),
 30                new global::HotChocolate.Types.MutationTypeAttribute());
 31            configuration.ConfigurationsAreApplied = true;
 32
 33            var naming = descriptor.Extend().Context.Naming;
 34
 35            descriptor
 36                .Field(naming.GetMemberName("AddTag", 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.Works.Mutations.AddTagPayload), HotChocolate.Types.T
 46                        new global::HotChocolate.Language.NonNullTypeNode(new global::HotChocolate.Language.NamedTypeNod
 47                    configuration.ResultType = typeof(global::Api.Works.Mutations.AddTagPayload);
 48                    configuration.DeclaringType = context.ThisType;
 49
 50                    configuration.SetSourceGeneratorFlags();
 51
 52                    var bindingInfo = field.Context.ParameterBindingResolver;
 53                    var parameter = context.Resolvers.CreateParameterDescriptor_AddTagAsync_input();
 54                    var parameterInfo = bindingInfo.GetBindingInfo(parameter);
 55
 56                    if(parameterInfo.Kind is global::HotChocolate.Internal.ArgumentKind.Argument)
 57                    {
 58                        var argumentConfiguration = new global::HotChocolate.Types.Descriptors.Configurations.ArgumentCo
 59                        {
 60                            Name = naming.GetMemberName("input", global::HotChocolate.Types.MemberKind.Argument),
 61                            Type = global::HotChocolate.Types.Descriptors.TypeReference.Create(
 62                                typeInspector.GetTypeRef(typeof(global::Api.Works.Mutations.AddTagInput), HotChocolate.T
 63                                new global::HotChocolate.Language.NonNullTypeNode(new global::HotChocolate.Language.Name
 64                            RuntimeType = typeof(global::Api.Works.Mutations.AddTagInput)
 65                        };
 66
 67                        configuration.Arguments.Add(argumentConfiguration);
 68                    }
 69
 70                    configuration.Member = context.ThisType.GetMethod(
 71                        "AddTagAsync",
 72                        global::HotChocolate.Utilities.ReflectionUtils.StaticMemberFlags,
 73                        new global::System.Type[]
 74                        {
 75                            typeof(global::Api.Database.PGContext),
 76                            typeof(global::Api.Auth.Utils.ICurrentUserId),
 77                            typeof(global::Api.Database.Utils.IEFTransactionDIAccessorService),
 78                            typeof(global::FluentValidation.IValidator<global::Api.Works.Mutations.AddTagInput>),
 79                            typeof(global::Api.Works.Mutations.AddTagInput),
 80                            typeof(global::System.Threading.CancellationToken)
 81                        })!;
 82
 83                    var fieldDescriptor = global::HotChocolate.Types.Descriptors.ObjectFieldDescriptor.From(field.Contex
 84                    HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
 85                        field.Context,
 86                        fieldDescriptor,
 87                        configuration.Member,
 88                        new global::Api.Auth.Handlers.PermissionCheckAuthorizeAttribute(global::Api.Auth.Models.UserPerm
 89                        new global::HotChocolate.Types.ErrorAttribute(typeof(global::Api.Utils.DomainError)));
 90
 91                    bindingResolver.ApplyConfiguration(
 92                        context.Resolvers.CreateParameterDescriptor_AddTagAsync_input(),
 93                        fieldDescriptor);
 94
 95                    configuration.ConfigurationsAreApplied = true;
 96                    fieldDescriptor.CreateConfiguration();
 97
 98                    configuration.Resolvers = context.Resolvers.AddTagAsync();
 99                },
 100                (Resolvers: resolvers, ThisType: thisType));
 101
 102            Configure(descriptor);
 103        }
 104
 105        static partial void Configure(global::HotChocolate.Types.IObjectTypeDescriptor descriptor);
 106
 107        private sealed class __Resolvers
 108        {
 109            private readonly global::HotChocolate.Internal.IParameterBinding _binding_AddTagAsync_input;
 110
 1111            public __Resolvers(global::HotChocolate.Resolvers.ParameterBindingResolver bindingResolver)
 1112            {
 1113                _binding_AddTagAsync_input = bindingResolver.GetBinding(CreateParameterDescriptor_AddTagAsync_input());
 1114            }
 115
 116            public global::HotChocolate.Internal.ParameterDescriptor CreateParameterDescriptor_AddTagAsync_input()
 1117                => new HotChocolate.Internal.ParameterDescriptor(
 1118                    "input",
 1119                    typeof(global::Api.Works.Mutations.AddTagInput),
 1120                    isNullable: false,
 1121                    []);
 122
 123            public HotChocolate.Resolvers.FieldResolverDelegates AddTagAsync()
 1124                => new global::HotChocolate.Resolvers.FieldResolverDelegates(resolver: AddTagAsync);
 125
 126            private async global::System.Threading.Tasks.ValueTask<global::System.Object?> AddTagAsync(global::HotChocol
 0127            {
 0128                var args0 = context.Service<global::Api.Database.PGContext>();
 0129                var args1 = context.Service<global::Api.Auth.Utils.ICurrentUserId>();
 0130                var args2 = context.Service<global::Api.Database.Utils.IEFTransactionDIAccessorService>();
 0131                var args3 = context.Service<global::FluentValidation.IValidator<global::Api.Works.Mutations.AddTagInput>
 0132                var args4 = _binding_AddTagAsync_input.Execute<global::Api.Works.Mutations.AddTagInput>(context);
 0133                var args5 = context.RequestAborted;
 0134                var result = await global::Api.Works.Mutations.AddTagMutations.AddTagAsync(args0, args1, args2, args3, a
 0135                return result;
 0136            }
 137        }
 138    }
 139}
 140