getBlocklist method

Future<GetBlocklist$Query$Blocklist> getBlocklist({
  1. int? first,
  2. BlocklistCursor? after,
  3. int? last,
  4. BlocklistCursor? before,
})

Returns Users blocked by this MyUser as BlocklistRecords.

Sorting

Returned Users are sorted primarily by their blocking DateTime, and secondary by their IDs (if the blocking DateTime is the same), in descending order.

Pagination

It's allowed to specify both first and last counts at the same time, provided that after and before cursors are equal. In such case the returned page will include the BlocklistRecord pointed by the cursor and the requested count of BlocklistRecords preceding and following it.

If it's desired to receive the BlocklistRecord, pointed by the cursor, without querying in both directions, one can specify first or last count as 0.

Implementation

Future<GetBlocklist$Query$Blocklist> getBlocklist({
  int? first,
  BlocklistCursor? after,
  int? last,
  BlocklistCursor? before,
}) async {
  Log.debug('getBlocklist($first, $after, $last, $before)', '$runtimeType');

  final variables = GetBlocklistArguments(
    first: first,
    after: after,
    last: last,
    before: before,
  );
  final QueryResult result = await client.query(
    QueryOptions(
      operationName: 'GetBlocklist',
      document: GetBlocklistQuery(variables: variables).document,
      variables: variables.toJson(),
    ),
  );
  return GetBlocklist$Query.fromJson(result.data!).blocklist;
}