Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/base_connection.py
Show All 14 Lines | |||||
@dataclass | @dataclass | ||||
class PageInfo: | class PageInfo: | ||||
hasNextPage: bool | hasNextPage: bool | ||||
endCursor: str | endCursor: str | ||||
class BaseConnection(ABC): | class BaseConnection(ABC): | ||||
""" | """ | ||||
Base class for all the connection resolvers | Base resolver for all the connections | ||||
""" | """ | ||||
_node_class: Optional[Type[BaseNode]] = None | _node_class: Optional[Type[BaseNode]] = None | ||||
_page_size = 50 # default page size | _page_size = 50 # default page size | ||||
def __init__(self, obj, info, paged_data=None, **kwargs): | def __init__(self, obj, info, paged_data=None, **kwargs): | ||||
self.obj = obj | self.obj = obj | ||||
self.info = info | self.info = info | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |