33

If you've moved your API from REST to GraphQL, were you happy with the o...

 5 years ago
source link: https://www.tuicool.com/articles/hit/VRfYjqu
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Mostly, NOTE: I'm using python/django/graphene server side and apollo client side.

I love how flexible it is for client developers and because the great client side libraries it helps to eliminate a ton of boiler plate code on the client side.

My biggest complaint has been "lost" exceptions and caching.

Because it's possible for an exception to be thrown server side on one field while the other ones succeed I've been plagued with hard to monitor/find errors. I ended up writing a shim to parse the response in an attempt to get more insight into #errors / fields (this has also been really helpful for monitoring slow queries in new relic since all requests go to the same endpoint which breaks a ton of APM monitoring).

My other issue has been around caching, in apollo there are ways to say "don't use the cache for this request", but it's not to give an object a cache ttl. My app allows users to search for events that are happening near them right now, and I've run into several issues where apollo decided that an event from yesterday should be added to a result. It happened frequently enough even with queries that included times as an argument that I ended up basically implementing a "middleware" between what apollo gives back and the component, which felt really ugly.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK