Use the is_graph rather than the class.