Add type attribute to graph