Monday, April 27, 2020

A Look at GraphQL

REST is rather straight forward, has been around for a while and not a new buzzword. It is basically using http "verb" to do "CRUD" on your resource in URL. (where the verbs are POST, GET, PUT, DELETE), and "CRUD" being create-read-update-delete.

Straight forward (and relatively easy) is not good enough for some. It is not fast enough... suppose you want to get a list of people... and their friends... you would have to make http calls and combine results. Enter GraphQL. Nice presentation.

So this is like a little SQL language. Maybe worth incorporating to your work. Let's look at implementing... Alas how complex do you want to get? See https://www.graphql-java.com/tutorials/getting-started-with-spring-boot/#graphql-java-overview.

However I found this awesome simple example that I can actually even run: https://dzone.com/articles/a-beginners-guide-to-graphql-with-spring-boot. Thanks to DZone. The example I downloaded from github is very helpful.

Look, add a ton of complexity with big learning curve may not worth it... internally somebody still has to do the queries and somebody will need to parse that JSON... Use it only if you think it is worth it.

1 comment:

Packers and Movers Gurgaon said...
This comment has been removed by a blog administrator.