swh.graphql.resolvers.base_connection module#
- class swh.graphql.resolvers.base_connection.PageInfo(hasNextPage: bool, endCursor: str | None)[source]#
Bases:
object
- class swh.graphql.resolvers.base_connection.ConnectionEdge(node: Any, cursor: str | None)[source]#
Bases:
object
- class swh.graphql.resolvers.base_connection.ConnectionData(paged_result: swh.core.api.classes.PagedResult[TResult, str], total_count: int | None = None)[source]#
Bases:
object
- paged_result: PagedResult[TResult, str]#
- class swh.graphql.resolvers.base_connection.BaseConnection(obj, info, data=None, **kwargs)[source]#
Bases:
ABC
Base resolver for all the connections
- property edges: List[ConnectionEdge]#
Return the list of connection edges, each with a cursor
- property nodes: List[BaseNode | object]#
Override if needed; return a list of objects
If a node class is set, return a list of its (Node) instances else a list of raw results
- property totalCount: int | None#
Will be None for most of the connections override if needed/possible
- get_connection_data() ConnectionData [source]#
Cache to avoid multiple calls to the backend
_get_connection_data()