updateUserLogin method

Future<MyUserEventsVersionedMixin?> updateUserLogin(
  1. UserLogin? login
)

Updates MyUser.login field for the authenticated MyUser.

Authentication

Mandatory.

Result

One of the following MyUserEvents may be produced on success:

Idempotent

Succeeds as no-op (and returns no MyUserEvent) if the authenticated MyUser uses the provided login already.

Implementation

Future<MyUserEventsVersionedMixin?> updateUserLogin(UserLogin? login) async {
  Log.debug('updateUserLogin($login)', '$runtimeType');

  final variables = UpdateUserLoginArguments(login: login);
  QueryResult res = await client.mutate(
    MutationOptions(
      operationName: 'UpdateUserLogin',
      document: UpdateUserLoginMutation(variables: variables).document,
      variables: variables.toJson(),
    ),
    onException: (data) => UpdateUserLoginException(
      (UpdateUserLogin$Mutation.fromJson(data).updateUserLogin
              as UpdateUserLogin$Mutation$UpdateUserLogin$UpdateUserLoginError)
          .code,
    ),
  );
  return UpdateUserLogin$Mutation.fromJson(res.data!).updateUserLogin
      as MyUserEventsVersionedMixin?;
}