Open jasonx1218 opened 1 year ago
I ran into this issue as well. I think something changed in the newer versions of strawberry. I didn't have this problem last year.
I created a new PageInfo
type and explicitly added the Shareable
directive to get around the issue.
@type(description="Information to aid in pagination.")
class PageInfo:
has_next_page: bool = field(
description="When paginating forwards, are there more items?",
directives=[Shareable()],
)
has_previous_page: bool = field(
description="When paginating backwards, are there more items?",
directives=[Shareable()],
)
start_cursor: Optional[str] = field(
description="When paginating backwards, the cursor to continue.",
directives=[Shareable()],
)
end_cursor: Optional[str] = field(
description="When paginating forwards, the cursor to continue.",
directives=[Shareable()],
)
@strawberry.type
class MyConnection(relay.ListConnection[MyNode]):
page_info: PageInfo = field(
description="Pagination data for this connection",
)
...
@RonquilloAeon would have some time to make a tiny reproduction? that will help fixing this issue :D
Feature Request Type
Errors being thrown
Description / Request
When using
relay.connection
,type PageInfo
is automatically generated and part of the schema. There should be an easier way to mark these automated/built-in types as@shareable
or possibly with other federated schema directives.Currently using a workaround before writing the schema to file:
which writes out the federated directive
and the type
Upvote & Fund