Because of the harsh working environment, there is usually a lack of effective data from the gearboxes of wind turbines for fault classification. In this paper, a fault-diagnosis model based on graph neural networks and one-shot learning is proposed to solve the problem of fault classification with limited data. In the proposed method, the short-time Fourier transform is used to convert one-dimensional vibration signals into two-dimensional data, then feature vectors are extracted from the two-dimensional data, and small-sample learning is achieved. An experimental rig was built to simulate the real working scenario of a wind turbine, and the results indicate the high classification accuracy of the proposed method. Furthermore, its effectiveness is verified in comparisons with Siamese, matching and prototypical networks, with the proposed method outperforming all of them.