Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/search.py
Show All 21 Lines | class ResolveSwhidConnection(BaseConnection): | ||||
_node_class = SearchResultNode | _node_class = SearchResultNode | ||||
def _get_paged_result(self) -> PagedResult: | def _get_paged_result(self) -> PagedResult: | ||||
swhid = self.kwargs.get("swhid") | swhid = self.kwargs.get("swhid") | ||||
results = [] | results = [] | ||||
if self.archive.is_object_available(swhid.object_id, swhid.object_type): | if self.archive.is_object_available(swhid.object_id, swhid.object_type): | ||||
results = [ | results = [ | ||||
{ | { | ||||
"target_hash": swhid.object_id, | "target_id": swhid.object_id, | ||||
"type": swhid.object_type.name.lower(), | "type": swhid.object_type.name.lower(), | ||||
} | } | ||||
] | ] | ||||
return PagedResult(results=results) | return PagedResult(results=results) | ||||
class SearchConnection(BaseConnection): | class SearchConnection(BaseConnection): | ||||
Show All 14 Lines |