Accurate forecasting of photovoltaic (PV) energy production with high spatiotemporal resolution is important for efficiently integrating renewable energy sources into the power grid. In this paper, we explore the application of graph neural networks (GNNs), specifically Graph Convolutional Networks (GCN), Graph Attention Networks (GAT), and GraphSage, for spatiotemporal PV energy prediction. The GNNs leverage the spatial and temporal dependencies among PV systems by modeling them as signals on a graph, capturing their intricate relationships, and enhancing forecasting accuracy. We investigate the impact of different graph neural network topologies on prediction performance, including distance-based and fully connected graphs. Moreover, we propose a composite model that predicts the PV energy output for any node within the stations’ network, enabling localized and accurate forecasts. The composite model is further extended to handle various prediction horizons ranging from one minute to 30 min ahead. To evaluate the effectiveness of the considered models, data from seven distinct PV systems in Brisbane, Australia, are used to evaluate the prediction performance of the three GNN models. Results demonstrate the effectiveness of graph neural networks in achieving superior forecasting accuracy and underscore their potential in revolutionizing the prediction of PV energy under spatiotemporal constraints, thus contributing to the advancement of renewable energy integration and grid management.