That code comes from a function that was only intended for usage with the admin panel, we opened up the REST endpoint but it’s structure still expects that it’s used over REST. Since the admin panel doesn’t use GraphQL at all this might be that easy.
Honestly since it’s just a dump of the locales, I would honestly suggest using REST for it. I’m not a fan of just picking REST or GraphQL and only using one of them, it’s about picking the right tool for the job and in cases like this where you really don’t need (or even have control) over what fields you select and you just want to get the data, a simple REST GET request is far better (and cachable) then a GQL POST request.