Mental health is an essential part of overall health and wellbeing. Alcohol abuse, dementia, depression, drug abuse and psychoses are common mental health issues that have been found to have to impact on an individual’s physical health. This study proposed a risk prediction model based on administrative data that assesses the risk of mental health issues using a machine learning on graphs technique. For this purpose, a patient network is built from two cohorts (i.e., patients with mental health issues and patients without mental health issues) using the bipartite graph projection technique. We then use graph neural network (GNN) models and test various edge types (i.e., simple weighting, Jaccard index and overlap weighting) to predict the risk of mental health issues. The GNN models show outstanding performance compared to baseline models, and the accuracy ranged from 85.08% to 90.59%. Moreover, the pattern for the two cohorts can be demonstrated by visualising the last hidden layers of GNN models using the principal component analysis technique, confirming the discriminative strength of the GNN models. The proposed risk prediction framework could help medical practitioners and other stakeholders build health management strategies for people at high risk of acquiring mental health issues.