Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/snapshot.py
Show All 34 Lines | |||||
class SnapshotNode(BaseSnapshotNode): | class SnapshotNode(BaseSnapshotNode): | ||||
""" | """ | ||||
Node resolver for a snapshot requested directly with its SWHID | Node resolver for a snapshot requested directly with its SWHID | ||||
""" | """ | ||||
def _get_node_data(self): | def _get_node_data(self): | ||||
""" """ | """ """ | ||||
snapshot_id = self.kwargs.get("swhid").object_id | swhid = self.kwargs.get("swhid") | ||||
if archive.Archive().is_snapshot_available([snapshot_id]): | if archive.Archive().is_object_available(swhid.object_id, swhid.object_type): | ||||
return self._get_snapshot_by_id(snapshot_id) | return self._get_snapshot_by_id(swhid.object_id) | ||||
return None | return None | ||||
class VisitSnapshotNode(BaseSnapshotNode): | class VisitSnapshotNode(BaseSnapshotNode): | ||||
""" | """ | ||||
Node resolver for a snapshot requested from a visit-status | Node resolver for a snapshot requested from a visit-status | ||||
""" | """ | ||||
Show All 38 Lines |