BooleanValue : one of true false
NullValue : null
EnumValue : Name but not true, false or null
public parseValueLiteral ( $isConst ) : |
||
$isConst | ||
리턴 |
/** * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for * that value. * Throws GraphQLError 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: valueFromAST(). * * @param Source|string $source * @param array $options * @return BooleanValue|EnumValue|FloatValue|IntValue|ListValue|ObjectValue|StringValue|Variable */ 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; }