directLinks method
- ChatId? chatId,
- DirectLinksFilter? by,
- 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:
- If the
by.slugargument is specified, then an exact DirectLink is returned. - Otherwise, the returned DirectLinks are sorted primarily by their DirectLink.createdAt field, and secondary by their DirectLink.slug field, in descending order.
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;
}