DEV Community

Discussion on: REST vs GraphQL APIs, the Good, the Bad, the Ugly

Collapse
 
maxgoldst profile image
Max Goldstein

Regarding your section on "shared nothing", you are correct that as long as any API endpoint can be serviced by a single backend microservice, all you need is a gateway to route the incoming request to the correct service. However, as soon as you want an endpoint that pulls data from multiple microservices, it appears to me that REST isn't particularly helpful. You essentially have to handle the request in the gateway, which makes internal requests (REST, GraphQL, kafka, whatever) to the microservices. The gateway then has to compose the outgoing JSON which requires knowing about two internal APIs and one external one. With GraphQL, the notion of resolvers makes this somewhat easier.