Cache the result of the graph query for better performance