HATEOAS vs GraphQL criteria set for microservices?

I recently talked with someone who said they completely abandoned the development of HATEOAS REST endpoints in favor of GraphQL. Therefore, I am interested to know what criteria are set for deciding when to use GraphQL or HATEOAS, or is GraphQL the best choice for the Gateway / Edge Server API architecture?

+4
source share
2 answers

Pros and cons of each of them:

GraphQL

Pro:

  • provides accurate control of returned data to avoid unnecessary traffic.
  • eliminates the need to return to the well again and again for attached / โ€œfollow-upโ€ data.
  • , - , GraphQL " >
  • API.

Con:

  • ( , )

HATEOAS/REST

Pro:

  • - .
  • , , CDN .
  • .

Con:

  • " "
  • ()
  • .

, GraphQL API REST, . /, GraphQL , API ; , REST.

, , , GraphQL . , HATEOAS, " ".

, Phil Sturgeon GraphQL vs REST:

+4

, , , , .

.

https://blog.apisyouwonthate.com/representing-state-in-rest-and-graphql-9194b291d127

GraphQL " " , , , , , , .

, , , HTTP-API, .

, !:)

+2

Source: https://habr.com/ru/post/1685111/


All Articles