What’s the best approach: GraphQL vs REST for our internal reporting API?
#1
I’m trying to decide between using a RESTful design or moving to GraphQL for our new internal reporting API, and I’m stuck on the trade-offs. The main issue is that our front-end team keeps requesting specific nested data shapes that are awkward to serve with multiple REST endpoints, but I’m worried about the complexity of implementing a whole new query language and the caching headaches it might bring.
Reply
#2
We started with REST and a few composite endpoints. It was fine for a while, but the front end kept asking for data in nested shapes and we ended up writing dozens of specialized endpoints just to stitch one page together. Caching got brittle because every composite response carried its own invalidation rules. We added a backend-for-frontend in front of the API to compose what the UI needs and started caching at that layer with ETag per shape. It helped a bit, but it still feels fragile whenever the shapes change.
Reply
#3
From the frontend side, those nested shapes are a daily headache. REST means extra round trips or awkward client-side stitching. The idea of GraphQL sounded great, so we tried a small pilot in another project. It did reduce round trips, but the tooling, schema churn, and caching were a bigger lift than we expected, and we never settled on a stable approach.
Reply
#4
I keep wondering if the real problem isn't the shape requests at all but whether we should rethink what data the UI actually needs. Maybe we need to rework the data model or build a BFF that serves the right view models, so the client doesn't care where the data comes from. Is the nesting symptom masking something deeper?
Reply
#5
We ended up taking a phased approach: keep REST for now, but add a backend-for-frontend that tailors the shapes, and introduce sparse fieldsets so clients can opt out of heavy payloads. We track payload size and average time to first byte; the numbers guide the next steps, but it's early days and I'm not sure it'll hold. If the gains plateau, we can run a short pilot with a specialized query layer, but only if the team is ready to invest in caching and schema governance.
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: