Graph neural networks (GNNs) have been extensively studied for prediction tasks on graphs. Aspointed out by recent studies, most GNNs assume local homophily, i.e., strong similarities in localneighborhoods. This assumption however limits the generalizability power of GNNs. To address thislimitation, we propose a flexible GNN model, which is capable of handling any graphs without beingrestricted by their underlying homophily. At its core, this model adopts a node attention mechanismbased on multiple learnable spectral filters; therefore, the aggregation scheme is learned adaptivelyfor each graph in the spectral domain. We evaluated the proposed model on node classification tasksover seven benchmark datasets. The proposed model is shown to generalize well to both homophilicand heterophilic graphs. Further, it outperforms all state-of-the-art baselines on heterophilic graphsand performs comparably with them on homophilic graphs.