| | | 1 | | // <auto-generated/> |
| | | 2 | | |
| | | 3 | | #nullable enable |
| | | 4 | | #pragma warning disable |
| | | 5 | | |
| | | 6 | | using System; |
| | | 7 | | using System.Runtime.CompilerServices; |
| | | 8 | | using HotChocolate; |
| | | 9 | | using HotChocolate.Types; |
| | | 10 | | using HotChocolate.Execution.Configuration; |
| | | 11 | | using Microsoft.Extensions.DependencyInjection; |
| | | 12 | | using HotChocolate.Internal; |
| | | 13 | | |
| | | 14 | | namespace 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() |
| | 1 | 83 | | => new global::HotChocolate.Resolvers.FieldResolverDelegates(resolver: GetCurrentUser); |
| | | 84 | | |
| | | 85 | | private async global::System.Threading.Tasks.ValueTask<global::System.Object?> GetCurrentUser(global::HotCho |
| | 1 | 86 | | { |
| | 1 | 87 | | var args0 = context.Service<global::Api.Database.PGContext>(); |
| | 1 | 88 | | var args1 = context.Service<global::Api.Auth.Utils.ICurrentUserId>(); |
| | 1 | 89 | | var args2 = context.RequestAborted; |
| | 1 | 90 | | var result = await global::Api.Auth.Queries.CurrentUserQueries.GetCurrentUser(args0, args1, args2); |
| | 1 | 91 | | return result; |
| | 1 | 92 | | } |
| | | 93 | | } |
| | | 94 | | } |
| | | 95 | | } |
| | | 96 | | |