arenanet / api-cdi

Collaborative Development Initiative for Public APIs
252 stars 41 forks source link

GraphQL interface as an alternative to REST for public client development. #678

Open ghost opened 2 years ago

ghost commented 2 years ago

GraphQL interface as an alternative to REST for public client development.

It would allow us to have more powerful queries to a single endpoint Reduces amount of requests made to obtain required and aggregate data Simplify code Decouple client code from the server rigid endpoint and response structure Prevent leaky data bloat in responses Allows query introspection Reduce overhead on the server with only one endpoint and only returning the data requested, no more, no less Remove throwing away unused data from rigid server responses, data/bandwidth waste Remove versioning overhead Can be run on top or beside the current REST as a migration or dual interface strategy Can be cached for performance both on clients and server side

See the following links for more details

https://graphql.org/ https://www.howtographql.com/

ghost commented 2 years ago

As an extra note, GraphQL would be a cleaner solution than batching REST queries to a new batch/bulk endpoint as there is still the problem of data over-fetching even though it results in less network roundtrips.