use a decorator for checking the graph_type