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

Scanning through the threads here it strikes me that nobody mentions the (IMHO) biggest advantage of GraphQL: subscriptions. Something which cannot be done with REST at all, but hugely improves the user experience by keeping your screen up-to-date at all times. This also caters to the increasing event-orientedness of programming in general. Regardless of REST vs GraphQL API design issues this is the main reason I use GraphQL.

(Side note: does anybody know why Apollo recommends using the websocket driver for subscriptions only?)



I don't use GraphQL and I have subscriptions or real time updates as well. On the backend whenever I do a equivalent of INSERT, UPDATE, DELETE I send a message over a websocket connection out to the connected clients. The client sends it's context whenever that changes so that the client only receives the necessary updates. I don't need GraphQL for that and I know what my code does, but with GraphQL I don't. I use Go on the server side and Angular or Flutter on the client side.


Good point! I don't yet see many people using subscriptions. Would be interesting to know what the blockers are. On the other hand there's the AsyncAPI specification which is also a good alternative.




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

Search: