public static function resolveNamedType($object)
{
if (is_object($object)) {
if ($object instanceof AbstractType) {
return $object->getType();
}
} elseif (is_null($object)) {
return null;
} elseif (is_scalar($object)) {
return new StringType();
}
throw new \Exception('Invalid type');
}