Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/visit_status.py
Show All 12 Lines | |||||
class BaseVisitStatusNode(BaseNode): | class BaseVisitStatusNode(BaseNode): | ||||
""" | """ | ||||
Base resolver for all the visit-status nodes | Base resolver for all the visit-status nodes | ||||
""" | """ | ||||
@property | @property | ||||
def snapshotSWHID(self): # To support the schema naming convention | def snapshotSWHID(self): # To support the schema naming convention | ||||
if self._node.snapshot is None: | |||||
return None | |||||
return CoreSWHID(object_type=ObjectType.SNAPSHOT, object_id=self._node.snapshot) | return CoreSWHID(object_type=ObjectType.SNAPSHOT, object_id=self._node.snapshot) | ||||
class LatestVisitStatusNode(BaseVisitStatusNode): | class LatestVisitStatusNode(BaseVisitStatusNode): | ||||
""" | """ | ||||
Node resolver for a visit-status requested from a visit | Node resolver for a visit-status requested from a visit | ||||
""" | """ | ||||
Show All 23 Lines |