I was talking to someone recently who said they are skipping the development of HATEOAS REST endpoints completely in favor of GraphQL. So I'm curious as to what the criteria set is for deciding when to use GraphQL vs. HATEOAS or is GraphQL just a better choice in general for an API Gateway / Edge Server architecture?
The pros and cons of each are:
Pro:
Con:
Pro:
Con:
One interesting comparison is that people use GraphQL as a frontend for REST APIs, but no-one in their right mind would consider doing the converse. If you go for a federated / microservices design, so one GraphQL server fronts for others, they can use a common specification of the API between the frontend and the microservices; this is less certainly true if the microservices are REST.
I think that so long as you have in mind the right questions to ask, GraphQL is going to be an important part of a well-designed system. Whether to skip HATEOAS entirely is unfortunately, "it depends".
My own experience, plus Phil Sturgeon's GraphQL vs REST: Overview