Skip to content

Commit 8b54dcd

Browse files
committed
find_breaking_changes: merge funcs and remove duplicated iteration logic
Replicates graphql/graphql-js@516132a
1 parent 9fcf253 commit 8b54dcd

File tree

3 files changed

+191
-226
lines changed

3 files changed

+191
-226
lines changed

graphql/type/definition.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,9 @@ def is_required_argument(arg: GraphQLArgument) -> bool:
578578
Thunk = Union[Callable[[], T], T]
579579

580580
GraphQLFieldMap = Dict[str, GraphQLField]
581-
GraphQLInterfaceList = Sequence["GraphQLInterfaceType"]
581+
GraphQLInterfaceList = Union[
582+
List["GraphQLInterfaceType"], Tuple["GraphQLInterfaceType"]
583+
]
582584

583585

584586
class GraphQLObjectType(GraphQLNamedType):
@@ -686,7 +688,7 @@ def fields(self) -> GraphQLFieldMap:
686688
def interfaces(self) -> GraphQLInterfaceList:
687689
"""Get provided interfaces."""
688690
try:
689-
interfaces = resolve_thunk(self._interfaces)
691+
interfaces: GraphQLInterfaceList = resolve_thunk(self._interfaces)
690692
except GraphQLError:
691693
raise
692694
except Exception as error:
@@ -810,7 +812,7 @@ def assert_interface_type(type_: Any) -> GraphQLInterfaceType:
810812
return cast(GraphQLInterfaceType, type_)
811813

812814

813-
GraphQLTypeList = Sequence[GraphQLObjectType]
815+
GraphQLTypeList = Union[List[GraphQLObjectType], Tuple[GraphQLObjectType]]
814816

815817

816818
class GraphQLUnionType(GraphQLNamedType):
@@ -877,7 +879,7 @@ def to_kwargs(self) -> Dict[str, Any]:
877879
def types(self) -> GraphQLTypeList:
878880
"""Get provided types."""
879881
try:
880-
types = resolve_thunk(self._types)
882+
types: GraphQLTypeList = resolve_thunk(self._types)
881883
except GraphQLError:
882884
raise
883885
except Exception as error:

0 commit comments

Comments
 (0)