Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

StringType::parseLiteralpublicWC 1.0

Method of the class: StringType{}

No Hooks.

Returns

null. Nothing (null).

Usage

$StringType = new StringType();
$StringType->parseLiteral( $valueNode, ?array $variables ): string;
$valueNode(Node) (required)
.
?array $variables
.
Default: null

StringType::parseLiteral() code WC 10.9.1

public function parseLiteral(Node $valueNode, ?array $variables = null): string
{
    if ($valueNode instanceof StringValueNode) {
        return $valueNode->value;
    }

    $notString = Printer::doPrint($valueNode);
    throw new Error("String cannot represent a non string value: {$notString}", $valueNode);
}