view raw
lem lem - 6 months ago 53
reST (reStructuredText) Question

Is GraphQL stateless?

Out of curiosity I start to read about GraphQL. Based on the samples on this article, it looks like REST API request to me. Is it stateless? means it has no request, no response from the server? If yes, then how come it is more resource lighter than REST API?


GraphQL is often referred to as more efficient than REST because it allows clients to ask for multiple resources in one request, which saves round trips, and also allows clients to filter down to only the fields they actually need. So at the end of the day the way requests are done seems similar, but the more powerful query language allows the client to get exactly the data they need and no more.

And yes, it's stateless just like REST is. In fact some might say that GraphQL meets a lot of the original requirements that REST described.