Updated graph createNode method to specify type on creation