Inferring halo masses with Graph Neural Networks