Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/graphql_relay/connection/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ class PageInfoType(Protocol):
def startCursor(self) -> Optional[ConnectionCursor]:
...

@property
def endCursor(self) -> Optional[ConnectionCursor]:
...

@property
def hasPreviousPage(self) -> bool:
...

@property
def hasNextPage(self) -> bool:
...

Expand Down
12 changes: 12 additions & 0 deletions tests/connection/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
connection_definitions,
connection_from_array,
forward_connection_args,
PageInfoType,
)

from ..utils import dedent
Expand Down Expand Up @@ -98,6 +99,17 @@ class User(NamedTuple):
schema = GraphQLSchema(query=query_type)


def describe_page_info_type():
def defines_all_members_as_properties():
for member_name in (
"startCursor",
"endCursor",
"hasPreviousPage",
"hasNextPage",
):
assert type(getattr(PageInfoType, member_name)) is property


def describe_connection_definition():
def includes_connection_and_edge_fields():
source = """
Expand Down