The IEEE 802.11ax standard is designed to provide high-efficiency WLAN operating in dense deployment, with a focus on increasing robustness and uplink transmission. IEEE 802.11ax aims to deliver self-configuration and self-adaptation capabilities for interference management techniques in dense deployments, to improve overall network conditions. The IEEE 802.11ax medium strives to intelligently use network allocation vectors (NAV), which block simultaneous transmission of neighboring co-existing access points from transmitting for a set period of time. Given an acceptable collision probability, this collision avoidance strategy tends to degrade network throughput and increase transmission delays since the medium is never completely exploited. In this paper, we propose affinityGNN, a graph neural network approach to actively optimize network co-existence transmission in a dense scenario. We introduce direct-affinityGNN which considers direct communications between IEEE802.11ax-compliant wireless systems and in contrast, skip-affinityGNN, which considers communication between IEEE802.11ax and Legacy devises by aggregating neural messages from direct and skip (two-hop) communicating neighbors in the dense wireless network deployment. Extensive experimental results not only show the superior performance of our proposed model over the state-of-the-art, but also demonstrate its potentially good interpretability and robustness for wireless network structure.