Automattic\WooCommerce\Vendor\GraphQL\Language

Parser::parseInputValueDefinitionprivateWC 1.0

Method of the class: Parser{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->parseInputValueDefinition(): InputValueDefinitionNode;

Parser::parseInputValueDefinition() code WC 11.0.1

private function parseInputValueDefinition(): InputValueDefinitionNode
{
    $start = $this->lexer->token;
    $description = $this->parseDescription();
    $name = $this->parseName();
    $this->expect(Token::COLON);
    $type = $this->parseTypeReference();
    $defaultValue = null;
    if ($this->skip(Token::EQUALS)) {
        $defaultValue = $this->parseConstValue();
    }

    $directives = $this->parseDirectives(true);

    return new InputValueDefinitionNode([
        'name' => $name,
        'type' => $type,
        'defaultValue' => $defaultValue,
        'directives' => $directives,
        'loc' => $this->loc($start),
        'description' => $description,
    ]);
}