Skip to content

Commit 8939f4a

Browse files
committed
Use assert
1 parent dd75617 commit 8939f4a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

graphql/core/type/schema.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from functools import reduce
2-
from py._log import warning
32
from .definition import (
43
GraphQLObjectType,
54
GraphQLInterfaceType,
@@ -76,11 +75,10 @@ def type_map_reducer(map, type):
7675
return type_map_reducer(map, type.of_type)
7776

7877
if type.name in map:
79-
if map[type.name] != type:
80-
warning.warn(
81-
'Schema must contain unique named types but contains multiple types named "{}".'
82-
.format(type.name)
83-
)
78+
assert map[type.name] == type, (
79+
'Schema must contain unique named types but contains multiple types named "{}".'
80+
.format(type.name)
81+
)
8482
return map
8583
map[type.name] = type
8684

0 commit comments

Comments
 (0)