Kontakt

GraphQL

graphql.org

We have used GraphQL successfully in a number of projects and are are seeing an increasing adoption by bigger players. In our opinion, it is superior to classical REST-based APIs; so we suggest to ADOPT it especially for client-server communication.

Benefits

  • shared types between client and server
  • the client can decide which parts of the GraphQL model are needed for his particular use case
  • is transport-agnostic (HTTP is only the default)

Drawbacks

  • HTTP caching does not work, as all queries end up at the same endpoint URL

Alternatives

  • We've used swagger in the past, which works well if for some reason you need a classical REST-based API.
  • json:api is another alternative which appeared in a similar timeframe as GraphQL, though we think GraphQL is far superior due to its explicit type system