Well, with a couple of years of experience with REST APIs, it was time to try something new. That is how I ended up with GraphQL. This amazing new alternative to REST.
Turns out it is much more logical than REST and is really easy once your project starts growing. Yeah, the initial setup is a bit time taking but I guess it's worth the effort.
I heard they have caching and subscriptions. Apparently graphql has a feature to cache HTTP requests. It has several different caches like Network, Optimistic, etc. I started with Optimistic caching in a flutter graphql client library for a todo app. Apparently it checks the network for any change and then if none found, uses the cache.
Whereas subscriptions are a way to trigger information to the client upon some events on the server. I assume they are using WebSockets inbuilt. Still waiting to try this thing out.
Overall loved the coding part, code looks very nicely structured than the previous REST.
Check the repo over here -
https://github.com/visakhvjn/todo
Shall update when I find newer things as I learn them. A thing I observed was how there is a delay compared to the REST counterparts. Not sure if it's the way I am doing things, but the first look at performance says it's a bit slower than REST.
Also, if you guys are looking towards a new project, go ahead with NestJs with graphql plugin, it greatly simplifies the implementation process.
Hoping to make some exciting projects in this tech.
Top comments (0)