Hacker News new | ask | show | jobs
by pranayairan 2853 days ago
Coming from Mobile developers experience :

- Graphql does allow you to specify data you need and make the user experience better but this is only true in theory. Since in graphql it is so easy to ask any data there are high chances of your queries not optimized and you end up doing a complex operation spanning multiple domains because you can do it. In REST since domains are tightly defined chances of non-optimized request are less.

- Another major con with GraphQL on mobile is there are no alternatives than Apollo client yet. This ties you to 1 solution for your entire application.

- There are companies that tried to enable Querying over rest. Though it is not as flexible as GraphQL.

2 comments

Re: specifying data - In my experience, you always want to overfetch anyway if you want your offline experience to be any level of reasonable.

It's pretty lame when you're offline, see an item in a list, click on the item, and then the new view has no additional information that wasn't already in the list.

That said, I've built a fairly sizable GraphQL API at my startup (https://banter.fm) and am pretty happy with it, though not 100% convinced I'd use it again.

I don’t see any difference between an app making making one non-optimised GraphQL request for the data it needs vs. making dozens of allegedly “optimised” REST requests for that same data. If the API designer didn’t anticipate that use case then it’s going to be slow either way. Probably slower with REST due to the extra HTTP traffic, loss of query batching, etc.