Automattic\WooCommerce\Vendor\GraphQL\Type
Schema::isSubType
Returns true if the given type is a sub type of the given abstract type.
Method of the class: Schema{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Schema = new Schema(); $Schema->isSubType( $abstractType, $maybeSubType ): bool;
- $abstractType(AbstractType&Type) (required)
- .
- $maybeSubType(ImplementingType&Type) (required)
- .
Schema::isSubType() Schema::isSubType code WC 11.1.2
public function isSubType(AbstractType $abstractType, ImplementingType $maybeSubType): bool
{
if ($abstractType instanceof InterfaceType) {
return $maybeSubType->implementsInterface($abstractType);
}
assert($abstractType instanceof UnionType, 'only other option');
return $abstractType->isPossibleType($maybeSubType);
}