Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/snapshot.py
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | class TargetSnapshotNode(BaseSnapshotNode): | ||||
""" | """ | ||||
from .snapshot_branch import BaseSnapshotBranchNode | from .snapshot_branch import BaseSnapshotBranchNode | ||||
_can_be_null = True | _can_be_null = True | ||||
obj: Union[SearchResultNode, BaseSnapshotBranchNode] | obj: Union[SearchResultNode, BaseSnapshotBranchNode] | ||||
def _get_node_data(self): | def _get_node_data(self): | ||||
snapshot_id = self.obj.target_hash | snapshot_id = self.obj.target_id | ||||
return self._get_snapshot_by_id(snapshot_id) | return self._get_snapshot_by_id(snapshot_id) | ||||
class OriginSnapshotConnection(BaseConnection): | class OriginSnapshotConnection(BaseConnection): | ||||
""" | """ | ||||
Connection resolver for the snapshots in an origin | Connection resolver for the snapshots in an origin | ||||
""" | """ | ||||
Show All 11 Lines |