Automattic\WooCommerce\Vendor\GraphQL\Type\Definition
UnionType::assertValid
Method of the class: UnionType{}
No Hooks.
Returns
null. Nothing (null).
Usage
$UnionType = new UnionType(); $UnionType->assertValid(): void;
UnionType::assertValid() UnionType::assertValid code WC 10.9.1
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 (isset($resolveType) && ! is_callable($resolveType)) {
$notCallable = Utils::printSafe($resolveType);
throw new InvariantViolation("{$this->name} must provide \"resolveType\" as null or a callable, but got: {$notCallable}.");
}
}