Hacker News new | ask | show | jobs
by satvikpendem 980 days ago
> REST is great if you're a backend or infra developer

Not sure about that, we have a codebase that's huge, with 100s of REST endpoints, and the backend engineers simply start writing new endpoints because frontend needs one more specific field, and the backend folks can't be bothered to refactor the codebase for an endpoint that's used elsewhere, as that takes time. GraphQL solves that cleanly by allowing the frontend to request any data they want and for the backend to focus on figuring out how to give back a piece of data if it's requested. No 100s of endpoints required.

2 comments

The only reason GraphQL is "better" is it forces documentation.

The fact is, you still need those endpoints, it's just your developers aren't afraid to change the GraphQL endpoints because they're documented. Sometime down the line your developers will become afraid to change the GQL endpoints and you'll have the same, but different, issue.

Not sure this always happens in practice. I’ve seen lots of redundant resolvers being implemented for the same type at work because someone didn’t know one already existed.