You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overriding one of the type constructors in one of the resolvers in arrayconnection.py breaks the return type of resolver.
For instance:
@dataclassclassCustomConnection:
edges: List[Edge]
pageInfo: PageInfo# connection is typed as Connection, but it is actually CustomConnectionconnection=connection_from_array(
[],
connection_type=CustomConnection,
)
As with issue #29, this can be cleanly resolved using custom Protocol definitions, although there is the downside noted in that issue of the additional typing-extensions dependency.
Unlike the other issue, I think you could implement a partial solution using Callable, TypeVar, and overload from typing, without having the Protocol dependency. I'm pretty sure the resulting code would be extremely difficult to understand though, and it would be very verbose.