Added ability to eager load graphs by generating sql