Automattic\WooCommerce\Vendor\GraphQL\Utils

BuildClientSchema::buildInputValuepublicWC 1.0

Method of the class: BuildClientSchema{}

No Hooks.

Returns

UnnamedInputObjectFieldConfig.

Usage

$BuildClientSchema = new BuildClientSchema();
$BuildClientSchema->buildInputValue( $inputValueIntrospection ): array;
$inputValueIntrospection(array) (required)
.

BuildClientSchema::buildInputValue() code WC 10.9.4

public function buildInputValue(array $inputValueIntrospection): array
{
    $type = $this->getInputType($inputValueIntrospection['type']);

    $inputValue = [
        'description' => $inputValueIntrospection['description'],
        'type' => $type,
    ];

    if (isset($inputValueIntrospection['defaultValue'])) {
        $inputValue['defaultValue'] = AST::valueFromAST(
            Parser::parseValue($inputValueIntrospection['defaultValue']),
            $type
        );
    }

    return $inputValue;
}