public static function interfacesAreCorrectlyImplemented()
{
return function ($context) {
/** @var Schema $schema */
$schema = $context['schema'];
$errors = [];
foreach ($schema->getTypeMap() as $typeName => $type) {
if ($type instanceof ObjectType) {
foreach ($type->getInterfaces() as $iface) {
try {
// FIXME: rework to return errors instead
self::assertObjectImplementsInterface($schema, $type, $iface);
} catch (\Exception $e) {
$errors[] = $e;
}
}
}
}
return $errors;
};
}