Skip to content

Fix: is_leaf_type matches type definition. #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions graphql/type/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def is_output_type(type):


def is_leaf_type(type):
named_type = get_named_type(type)
return isinstance(named_type, (
return isinstance(type, (
GraphQLScalarType,
GraphQLEnumType,
))
Expand Down
4 changes: 2 additions & 2 deletions graphql/validation/rules/scalar_leafs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ...error import GraphQLError
from ...type.definition import is_leaf_type
from ...type.definition import get_named_type, is_leaf_type
from .base import ValidationRule


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

if is_leaf_type(type):
if is_leaf_type(get_named_type(type)):
if node.selection_set:
self.context.report_error(GraphQLError(
self.no_subselection_allowed_message(node.name.value, type),
Expand Down