Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

InterfaceType::assertValid │ public │ WC 1.0

Method of the class: InterfaceType{}

No Hooks.

Returns

null. Nothing (null).

Usage

$InterfaceType = new InterfaceType();
$InterfaceType->assertValid(): void;

InterfaceType::assertValid() code WC 11.1.2

public function assertValid(): void
{
    Utils::assertValidName($this->name);

    $resolveType = $this->config['resolveType'] ?? null;
    // @phpstan-ignore-next-line unnecessary according to types, but can happen during runtime
    if ($resolveType !== null && ! is_callable($resolveType)) {
        $notCallable = Utils::printSafe($resolveType);
        throw new InvariantViolation("{$this->name} must provide \"resolveType\" as null or a callable, but got: {$notCallable}.");
    }

    $this->assertValidInterfaces();
}