12 days ago by Dak

I Love Tech

How I made GraphQL Feel Like Cheating

From Twenty REST Calls to One GraphQL Gateway

How I made GraphQL Feel Like Cheating

At NCSOFT I was the sole dedicated backend developer on the Web Team. The work we did sat between our players and a maze of internal REST services. I rebuilt that layer as a single GraphQL endpoint in Node.js and TypeScript. Players waited less, engineers shipped faster, and shared code shrank by thousands of lines.

The initial pain was that each of our six live games needed data from as many as eight platform services. A single screen could force the client to fire twenty REST requests, then sit idle while the slowest answered. Each time a new game, event, or major patch went out, I found myself re-implementing the same workflows against the same services.

Engineers, myself included, started asking why we were doing the same work every sprint. The answer became obvious: one gateway, zero duplicate calls, and a contract that decoupled front-end teams from platform churn. "Implement once for any platform API" became the rule.

So I built the gateway using Node.js, TypeScript, Express, and plain graphql-js, fewer moving parts. One endpoint replaced twenty, one schema replaced six collections of API docs. Because the server lived in the same data center as the downstream services, the hop from Gateway → Platform dropped from roughly 120 ms to about 10 ms. Plus, with parallel resolver calls, the concurrency combined with the number of calls we were de-duplicating made things significantly faster.

DataLoader handled the in-request cache and automatic batching. A player request that used to fan out into 4-6 independent platform calls now collapsed into a single network round-trip per data type, and only once per request. Bandwidth fell, latency followed, and the client code that had stitched responses together was deleted.

Now whenever a new game, event, or major patch was planned, we barely had to touch the backend. We could just ship the client code immediately.


Enjoyed this post?
Follow me for more content like this.

Follow @dakdevs