Automattic\WooCommerce\Vendor\GraphQL\Utils

SchemaExtender::extendScalarTypeprotectedWC 1.0

Method of the class: SchemaExtender{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->extendScalarType( $type ): CustomScalarType;
$type(ScalarType) (required)
.

SchemaExtender::extendScalarType() code WC 10.9.1

protected function extendScalarType(ScalarType $type): CustomScalarType
{
    /** @var array<ScalarTypeExtensionNode> $extensionASTNodes */
    $extensionASTNodes = $this->extensionASTNodes($type);

    return new CustomScalarType([
        'name' => $type->name,
        'description' => $type->description,
        'serialize' => [$type, 'serialize'],
        'parseValue' => [$type, 'parseValue'],
        'parseLiteral' => [$type, 'parseLiteral'],
        'astNode' => $type->astNode,
        'extensionASTNodes' => $extensionASTNodes,
    ]);
}