Built an entire application using Apollo GraphQL. However, GraphQL lacks a lot of features and tooling.
Most of my experience is with Apollo GraphQL
- The hardest problem I faced is Authorization (not authentication). I tried graphql-shield , its still very basic.
- Existing cache solutions won't work. You need to implement it yourself or use Apollo's service. I also tried that one. But when I asked Apollo team, how to clear cache: "Oops we only have TTL, no way to clear cache". Most of the caching solutions, cdn etc are based on "URL", so its very easy to cache a route like
something.com/api/users/1.
Here is an article I wrote with RestAPI, this one cannot be done if you're using GraphQL: How I used CloudFlare to reduce API response time to < 100ms
- GraphQL subscriptions/live query is in a very early stage. I found it too difficult to find whether a user is online or not, how many active clients have connected etc. And very buggy (I've filed 2-3 bug requests, some of them are still open). Again I contacted Apollo, what they said is "Pay $4000 for a month to get our support from engineers". If I've chosen SocketIO instead, it will take only a couple of mins.
- Apollo Client library - one of the biggest mistakes we've done. We thought it will be easier than redux and implemented it, now I regret! I remember Dan Abramov's talk on last JSConfig, he said "Apollo Client library is really good, interesting project, but I think it's just 5% of redux"
- File uploads are tricky - The last time I used there was no proper way to upload files using GraphQL, however now they've some specs for it and there are some libraries. Even though when I choose a component for "File uploader" in React or something, what they'll do is just post it to a URL. In GraphQL, you can't get a URL like that.
I've left GraphQL for now
I found that most of the best companies implemented GraphQL on top of RestAPIs.
I found that a better approach is built RestAPI first, do proper authentication, authorization etc, later build GraphQL on top of this RestAPIs. So you're solving all the problems as I listed above + you can use GraphQL.
Right now I've left GraphQL and implemented everything in RestAPI using Loopback in our product MFY. Needless to say, Loopback is awesome, authentication and authorization are like in heaven!
Also, removed Apollo client libraries and rewrote everything in Redux.
Pretty happy now :) In future we've planned to build GraphQL on top of Rest API's