Skip to content

Commit 7b275a4

Browse files
authored
Merge pull request #107 from obi1kenobi/fix_leaf_type_check
Fix: is_leaf_type matches type definition.
2 parents a9744ae + 319a4a4 commit 7b275a4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

graphql/type/definition.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def is_output_type(type):
4141

4242

4343
def is_leaf_type(type):
44-
named_type = get_named_type(type)
45-
return isinstance(named_type, (
44+
return isinstance(type, (
4645
GraphQLScalarType,
4746
GraphQLEnumType,
4847
))

graphql/validation/rules/scalar_leafs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ...error import GraphQLError
2-
from ...type.definition import is_leaf_type
2+
from ...type.definition import get_named_type, is_leaf_type
33
from .base import ValidationRule
44

55

@@ -11,7 +11,7 @@ def enter_Field(self, node, key, parent, path, ancestors):
1111
if not type:
1212
return
1313

14-
if is_leaf_type(type):
14+
if is_leaf_type(get_named_type(type)):
1515
if node.selection_set:
1616
self.context.report_error(GraphQLError(
1717
self.no_subselection_allowed_message(node.name.value, type),

0 commit comments

Comments
 (0)