4using System.Threading.Tasks;
9using HotChocolate.Data;
10using HotChocolate.Types;
11using HotChocolate.Types.Relay;
13using Microsoft.Extensions.Options;
32 [Service] IOptionsSnapshot<SecurityConfiguration> securityConfigurationOptions)
34 ArgumentNullException.ThrowIfNull(securityConfigurationOptions);
35 return securityConfigurationOptions.Value.OidcStrictMode;
46 CancellationToken cancellationToken)
48 ArgumentNullException.ThrowIfNull(userAuthority);
49 return userAuthority.InvokeTransformable<Models.User,
User,
UserGraphQLTransformer>(authority => authority.Read(cancellationToken));
61 public ValueTask<User?>
ById(
62 [ID(nameof(
User))]
long id,
63 [Service] IUsersDataLoader usersDataLoader,
64 QueryContext<User>? queryContext,
65 CancellationToken cancellationToken)
66 =>
User.
GetUser(
id, usersDataLoader, queryContext, cancellationToken);
79 ArgumentNullException.ThrowIfNull(userAuthority);
81 authority => authority.Queryable(
false));
Exception representing ErrorMessageResponses.
A user registered in the server.
static ValueTask< User?> GetUser(long id, [Service] IUsersDataLoader usersDataLoader, QueryContext< User >? queryContext, CancellationToken cancellationToken)
Node resolver for Users.
Wrapper for accessing Users.
bool OidcStrictMode([Service] IOptionsSnapshot< SecurityConfiguration > securityConfigurationOptions)
If only OIDC logins and registration is allowed.
ValueTask< User > Current([Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Gets the current User.
ValueTask< User?> ById([ID(nameof(User))] long id, [Service] IUsersDataLoader usersDataLoader, QueryContext< User >? queryContext, CancellationToken cancellationToken)
Gets a User by Entity.Id.
async ValueTask< IQueryable< User > > QueryableUsers([Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority)
Queries all registered Users.
Invokes TAuthority s from GraphQL endpoints.