Check if graph stays connected after edge swap
Check this paper https://arxiv.org/pdf/1209.5608.pdf which uses cluster forest which support operations like:

connected(u, v) : if vertex u and v are connected , 
insert(u, v) : Insert edge (u, v) 
delete(u, v) : delete edge (u, v) 

It answers your query in O(log n / log log n) time with O(log2n / log log n) update time.