mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 12:56:05 +03:00
Fix: isLeafType should not return true for ListOfType and NonNull wrappers
This commit is contained in:
parent
c5484ae6f9
commit
4c96193027
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user