def clear_graph(node_label=None):
    """Generate query for removing everything from the graph.

    Parameters
    ----------
    label
        Label of the graph to remove. If None, all the database is cleared
    """
    if node_label is None:
        query = 'MATCH (n)\n'
    else:
        query = 'MATCH (n:{})\n'.format(node_label)
    query += 'OPTIONAL MATCH (n)-[r]-()\n' + 'DELETE n, r\n'
    return query
