def valid_field_in_graph(arch):
    """A `graph` must have `string` attribute and an immediate node of `graph` view must be `field`."""
    if arch.xpath('//graph[not (@string)]'):
        return False
    for child in arch.xpath('/graph/child::*'):
        if child.tag != 'field':
            return False
    return True