Inferring the interaction rules of complex systems with graph neural networks and approximate Bayesian computation