directLinks method

Future<DirectLinks$Query$DirectLinks> directLinks({
  1. ChatId? chatId,
  2. DirectLinksFilter? by,
  3. DirectLinksPagination? pagination,
})

Returns DirectLinks owned by the authenticated MyUser or the specified Chat-group, filtered by the provided criteria.

Searching by.slug is exact, returning only a single DirectLink and making the pagination meaningless.

Authentication

Mandatory.

Sorting

Returned DirectLinks are sorted depending on the provided arguments:

Implementation

Future<DirectLinks$Query$DirectLinks> directLinks({
  ChatId? chatId,
  DirectLinksFilter? by,
  DirectLinksPagination? pagination,
}) async {
  Log.debug(
    'updateGroupDirectLink(chatId: $chatId, by: $by, pagination: $pagination)',
    '$runtimeType',
  );

  final variables = DirectLinksArguments(
    chatId: chatId,
    by: by,
    pagination: pagination,
  );
  final QueryResult result = await client.query(
    QueryOptions(
      operationName: 'DirectLinks',
      document: DirectLinksQuery(variables: variables).document,
      variables: variables.toJson(),
    ),
  );
  return DirectLinks$Query.fromJson(result.data!).directLinks;
}