GraphQL

oh no, not another buzzword / Javascript framework for me to be aware of?!?

nope.  well, maybe, possibly, actually no.  It's the "new tool" on the block.

Okay, so you managed to get through your IT career (from 2000->) by using SOAP, you all recall the lovely XML that was being passed around, hugely complex, nightmare to navigate and get right, schemas always changing, people doing custom stuff and then having the immensely lovely job of parsing all that bloated XML, even if all you wanted was 1 field value.

Then REST APIs came along and we all rejoiced, JSON will destroy XML and life will be good.  REST allowed us to use GET, POST, DELETE and we could make endpoints that made sense.  Life was good.

As with all things new, the old ways soon caught up. Then we started to pass back via REST lots and lots of data and the UI layer would then have to extract out the actual data it needed.  There was no harm in sending back 10 fields that we currently didn't use in this particular UI screen, it won't be much overhead..... then of course that 10 becomes, 20, then 30, then 50, then 100....  we're now passing back loads of bloated JSON that we have to parse to get the actual data we need for the UI.  Also the UI is starts to lag in rendering times.  hmmmm.....

Along comes GraphQL.  It will be our new messiah, our new saviour.

Actually, it does a really good job of what is needed!



You create a model of what you want to fetch and just that is sent back, no more time spent parsing the JSON response, you just get what you need.  sweet.

I've currently been working on a project where we implemented GraphQL 3-4 months ago, it's great, if you get a chance to start from fresh on a project, I highly recommend using it and then you'll see just how nice your life will become.
As is always the way, I cannot see today how it will go the way of the past, it'll likely happen, but for now, I cannot see a time of it returning to ways of old, so full steam ahead.....

HERE is a great article to INTRODUCE you to GRAPHQL and the way it works, great stuff.


*Yes, I know, it's like ReactJS, it came from facebook, but, y'know, their developers do know a thing or two about building scalable stuff and how to support / maintain it too (take note Google.... yes, after so many years being an AngularJS advocate, I hang up that hat now.....)



Comments