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.
The text was updated successfully, but these errors were encountered:
As with #29, I'm adding a PR here to demonstrate a solution using Protocol. Even if this is deemed unpalatable right now, it be an acceptable change in the future.
Overriding one of the type constructors in one of the resolvers in arrayconnection.py breaks the return type of resolver.
For instance:
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
, andoverload
from typing, without having theProtocol
dependency. I'm pretty sure the resulting code would be extremely difficult to understand though, and it would be very verbose.The text was updated successfully, but these errors were encountered: