src/Language/Parser.php
public static function parseValue($source, array $options = [])
    {
        $sourceObj = $source instanceof Source ? $source : new Source($source);
        $parser    = new Parser($sourceObj, $options);
        $parser->expect(Token::SOF);
        $value = $parser->parseValueLiteral(false);
        $parser->expect(Token::EOF);

        return $value;
    }
public static function parseValue($source, array $options = [])
    {
        $sourceObj = $source instanceof Source ? $source : new Source($source);
        $parser    = new Parser($sourceObj, $options);
        $parser->expect(Token::SOF);
        $value = $parser->parseValueLiteral(false);
        $parser->expect(Token::EOF);

        return $value;
    }
public static function parseValue ( $ source , array $ options = [ ] ) { $ sourceObj = $ source instanceof Source ? $ source : new Source ( $ source ) ; $ parser = new Parser ( $ sourceObj , $ options ) ; $ parser -> expect ( Token :: SOF ) ; $ value = $ parser -> parseValueLiteral ( false ) ; $ parser -> expect ( Token :: EOF ) ; return $ value ; }
Given a string containing a GraphQL value (ex. `[42]`), parse the AST for
that value.
Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered.

This is useful within tools that operate upon GraphQL Values directly and
in isolation of complete GraphQL documents.

Consider providing the results to the utility function: `GraphQL\Utils\AST::valueFromAST()`.

@param Source|string $source
@param bool[]        $options

@return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode

@api
Given a string containing a GraphQL value ( ex . [ 42 ] ) parse the AST for that value . Throws GraphQL \ Error \ SyntaxError if a syntax error is encountered .