Automattic\WooCommerce\Vendor\GraphQL\Server

StandardServer::__constructpublicWC 1.0

Method of the class: StandardServer{}

No Hooks.

Returns

null. Nothing (null).

Usage

$StandardServer = new StandardServer();
$StandardServer->__construct( $config );
$config(required)
.

StandardServer::__construct() code WC 10.9.1

public function __construct($config)
{
    if (is_array($config)) {
        $config = ServerConfig::create($config);
    }

    // @phpstan-ignore-next-line necessary until we can use proper union types
    if (! $config instanceof ServerConfig) {
        $safeConfig = Utils::printSafe($config);
        throw new InvariantViolation("Expecting valid server config, but got {$safeConfig}");
    }

    $this->config = $config;
    $this->helper = new Helper();
}