Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/snapshot_branch.py
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | class SnapshotBranchConnection(BaseConnection): | ||||
def _get_after_arg(self): | def _get_after_arg(self): | ||||
# Snapshot branch is using a different cursor; logic to handle that | # Snapshot branch is using a different cursor; logic to handle that | ||||
# FIXME Cursor must be a hex to be consistent with | # FIXME Cursor must be a hex to be consistent with | ||||
# the base class, hack to make that work | # the base class, hack to make that work | ||||
after = utils.get_decoded_cursor(self.kwargs.get("after", "")) | after = utils.get_decoded_cursor(self.kwargs.get("after", "")) | ||||
return bytes.fromhex(after) | return bytes.fromhex(after) | ||||
def _get_index_cursor(self, index: int, node: SnapshotBranchNode): | |||||
# Snapshot branch is using a different cursor, hence the override | |||||
return utils.get_encoded_cursor(node.name.hex()) |