Single-Pass Contrastive Learning Can Work for Both Homophilic and Heterophilic Graph