def _unwrap_validator(validator):
    """
    Unwrap validator from wrappers such as NonNull etc.
    """
    while hasattr(validator, "of_type"):
        validator = validator.of_type
    return validator