def graph_resources(processor, graph):
    """Create graph with the overall hierarchy of resources."""
    if len(processor.organizations) > 0:
        for org in processor.organizations:
            graph.graph_organization(org)
    elif len(processor.folders) > 0:
        for folder in processor.folders:
            graph.graph_folder(folder)
    else:
        for project in processor.projects:
            graph.graph_project(project)
    return graph