Skip to content

Commit 6d6e89e

Browse files
committed
find_breaking_changes: Correctly document not reachable statement
Replicates graphql/graphql-js@ab93bf4
1 parent cd15f6e commit 6d6e89e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graphql/utilities/find_breaking_changes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from ..error import INVALID
55
from ..language import DirectiveLocation
6+
from ..pyutils import inspect
67
from ..type import (
78
GraphQLArgument,
89
GraphQLDirective,
@@ -285,7 +286,9 @@ def type_kind_name(type_: GraphQLNamedType) -> str:
285286
return "an Enum type"
286287
if is_input_object_type(type_):
287288
return "an Input type"
288-
raise TypeError(f"Unknown type {type_.__class__.__name__}")
289+
290+
# Not reachable. All possible output types have been considered.
291+
raise TypeError(f"Unexpected type {inspect(type)}") # pragma: no cover
289292

290293

291294
def find_fields_that_changed_type_on_object_or_interface_types(

0 commit comments

Comments
 (0)