mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-16 20:33:14 +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)
|
public static function isLeafType($type)
|
||||||
{
|
{
|
||||||
$nakedType = self::getNamedType($type);
|
return $type instanceof LeafType;
|
||||||
return $nakedType instanceof LeafType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,7 +25,7 @@ class ScalarLeafs
|
|||||||
NodeKind::FIELD => function(FieldNode $node) use ($context) {
|
NodeKind::FIELD => function(FieldNode $node) use ($context) {
|
||||||
$type = $context->getType();
|
$type = $context->getType();
|
||||||
if ($type) {
|
if ($type) {
|
||||||
if (Type::isLeafType($type)) {
|
if (Type::isLeafType(Type::getNamedType($type))) {
|
||||||
if ($node->selectionSet) {
|
if ($node->selectionSet) {
|
||||||
$context->reportError(new Error(
|
$context->reportError(new Error(
|
||||||
self::noSubselectionAllowedMessage($node->name->value, $type),
|
self::noSubselectionAllowedMessage($node->name->value, $type),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user