diff --git a/src/Type/Definition/Type.php b/src/Type/Definition/Type.php index c4d07fc..69a3789 100644 --- a/src/Type/Definition/Type.php +++ b/src/Type/Definition/Type.php @@ -138,8 +138,7 @@ abstract class Type implements \JsonSerializable */ public static function isLeafType($type) { - $nakedType = self::getNamedType($type); - return $nakedType instanceof LeafType; + return $type instanceof LeafType; } /** diff --git a/src/Validator/Rules/ScalarLeafs.php b/src/Validator/Rules/ScalarLeafs.php index 6da1723..de1f7d6 100644 --- a/src/Validator/Rules/ScalarLeafs.php +++ b/src/Validator/Rules/ScalarLeafs.php @@ -25,7 +25,7 @@ class ScalarLeafs NodeKind::FIELD => function(FieldNode $node) use ($context) { $type = $context->getType(); if ($type) { - if (Type::isLeafType($type)) { + if (Type::isLeafType(Type::getNamedType($type))) { if ($node->selectionSet) { $context->reportError(new Error( self::noSubselectionAllowedMessage($node->name->value, $type),