Wednesday, April 18, 2018

GraphQL

REST services are easy to implement in Pharo - especially with "Teapot" and my simple "Tealight" extensions for it. Read the Tealight project page with some documentation and examples to get an idea about it.

If you worked with or heard about REST then you might also come across GraphQL. It's a technology initially developed at Facebook.

In GraphQL, the shape of the response is built up on the server side to match the shape of a given JSON query.

So while in REST when you ask for a "book" item you receive a predefined JSON response with all attributes of the book. In GraphQL you might ask only for the books title or in another case for the books title and author at the same URL and receive an appropriate response.

Now there is also an initial library for GraphQL available for Pharo and VisualWorks.

Really nice!



No comments: