Data-Driven Graph Switching for Cyber-Resilient Control in Microgrids