createGroupChat method
Creates a Chat-group with the provided Users as members and the authenticated MyUser.
Implementation
Future<ChatMixin> createGroupChat(
List<UserId> memberIds, {
ChatName? name,
}) async {
Log.debug('createGroupChat($memberIds, $name)', '$runtimeType');
final variables = CreateGroupChatArguments(
memberIds: memberIds,
name: name,
);
final QueryResult result = await client.mutate(
MutationOptions(
operationName: 'CreateGroupChat',
document: CreateGroupChatMutation(variables: variables).document,
variables: variables.toJson(),
),
onException:
(data) => CreateGroupChatException(
(CreateGroupChat$Mutation.fromJson(data).createGroupChat
as CreateGroupChat$Mutation$CreateGroupChat$CreateGroupChatError)
.code,
),
);
return (CreateGroupChat$Mutation.fromJson(result.data!).createGroupChat
as CreateGroupChat$Mutation$CreateGroupChat$Chat);
}