removeUserEmail method
- UserEmail email, {
- MyUserCredentials? confirmation,
Deletes the given email
from MyUser.emails of the authenticated
MyUser.
Authentication
Mandatory.
Result
Only the following MyUserEvent may be produced on success:
Idempotent
Succeeds as no-op (and returns no MyUserEvent) if the authenticated
MyUser doesn't have the provided email
in his MyUser.emails already.
Implementation
Future<MyUserEventsVersionedMixin?> removeUserEmail(
UserEmail email, {
MyUserCredentials? confirmation,
}) async {
Log.debug(
'removeUserEmail($email, confirmation: $confirmation)',
'$runtimeType',
);
final variables = RemoveUserEmailArguments(
email: email,
confirmation: confirmation,
);
final QueryResult result = await client.mutate(
MutationOptions(
operationName: 'RemoveUserEmail',
document: RemoveUserEmailMutation(variables: variables).document,
variables: variables.toJson(),
),
onException: (data) => RemoveUserEmailException(
(RemoveUserEmail$Mutation.fromJson(data).removeUserEmail
as RemoveUserEmail$Mutation$RemoveUserEmail$RemoveUserEmailError)
.code,
),
);
return RemoveUserEmail$Mutation.fromJson(result.data!).removeUserEmail
as RemoveUserEmail$Mutation$RemoveUserEmail$MyUserEventsVersioned;
}