src/Schema/AST/PartialParser.php
protected static function getFirstAndValidateType(NodeList $list, string $expectedType): Node
    {
        if ($list->count() !== 1) {
            throw new ParseException('More than one definition was found in the passed in schema.');
        }

        $node = $list[0];

        return self::validateType($node, $expectedType);
    }
protected static function getFirstAndValidateType(NodeList $list, string $expectedType): Node
    {
        if ($list->count() !== 1) {
            throw new ParseException('More than one definition was found in the passed in schema.');
        }

        $node = $list[0];

        return self::validateType($node, $expectedType);
    }
protected static function getFirstAndValidateType ( NodeList $ list , string $ expectedType ) : Node { if ( $ list -> count ( ) !== 1 ) { throw new ParseException ( 'More than one definition was found in the passed in schema.' ) ; } $ node = $ list [ 0 ] ; return self :: validateType ( $ node , $ expectedType ) ; }
Get the first Node from a given NodeList and validate it.

@param  \GraphQL\Language\AST\NodeList  $list
@param  string  $expectedType
@return \GraphQL\Language\AST\Node

@throws \Nuwave\Lighthouse\Exceptions\ParseException
Get the first Node from a given NodeList and validate it .