Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Kinda, by all accounts the original motivation was to solve the proliferation of endpoints. Everyone was already writing per-screen endpoints to solve the network requests problem (which, contrary to what many believe, wasn't magically solve by http2), but they were doing it in a way which played out in several ways:

1. Having to make a new endpoint every time your frontend changes

2. Not making a new endpoint, and just augmenting the existing one for a screen. Which would cause them to accumulate dead data over time (especially if multiple app versions had to be supported concurrently -- in the case of Facebook this was ~3000 versions).

3. Being lazy and finding a similar endpoint meant for another use case and piggy-backing it for your new usage.

All of these would create maintenance and organisational problems.

GraphQL is essentially a system that lets you write endpoint specs (in the form of GraphQL query documents) that the backend knows how to support. It's not a free lunch, you still have to do a lot of work on the backend to allow it to do this efficiently and securely (nowhere near as difficult as people make it out to be though), but it does a really good job at solving the endpoint maintenance problem.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: