deleteUserDirectLink method

Future<MyUserEventsVersionedMixin?> deleteUserDirectLink()

Deletes the current ChatDirectLink 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 has no active ChatDirectLinks already.

Implementation

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

  final QueryResult result = await client.mutate(
    MutationOptions(
      operationName: 'DeleteUserDirectLink',
      document: DeleteUserDirectLinkMutation().document,
    ),
    onException:
        (data) => DeleteChatDirectLinkException(
          DeleteUserDirectLink$Mutation.fromJson(data).deleteChatDirectLink
              as DeleteChatDirectLinkErrorCode,
        ),
  );
  return DeleteUserDirectLink$Mutation.fromJson(
        result.data!,
      ).deleteChatDirectLink
      as MyUserEventsVersionedMixin?;
}