updateUserName method
- UserName? name
Updates MyUser.name field for the authenticated MyUser.
Authentication
Mandatory.
Result
One of the following MyUserEvents may be produced on success:
- EventUserNameUpdated (if
name
argument is specified); - EventUserNameDeleted (if
name
argument is absent or isnull
).
Idempotent
Succeeds as no-op (and returns no MyUserEvent) if the authenticated
MyUser uses the provided name
already.
Implementation
Future<MyUserEventsVersionedMixin?> updateUserName(UserName? name) async {
Log.debug('updateUserName($name)', '$runtimeType');
final variables = UpdateUserNameArguments(name: name);
QueryResult res = await client.mutate(
MutationOptions(
operationName: 'UpdateUserName',
document: UpdateUserNameMutation(variables: variables).document,
variables: variables.toJson(),
),
);
return UpdateUserName$Mutation.fromJson(res.data!).updateUserName;
}