What the heck is GraphQL

EDDYMENS
6 min readAug 21, 2019

Definition

GraphQL in itself is a specification describing a new way an app or web frontend asks for data from the server. This specification is built into libraries we end up implementing on our server-side as well as the client-side of our apps. Meaning if you are building a web app that has no APIs this might not interest you.

How is this different from the way we write APIs at the moment?

If you have ever written or used an API before its most likely a REST API, RPC or some other variant. For the most part, these options expose a host of functionalities like data fetching or manipulation.

As a person using these APIs, you frequently ask the questions what endpoint do I call or ping to do X, Y, Z and sometimes in what order.

As the creator of these endpoints, you also find yourself asking the question what query do I need to write to perform X, Y, Z when an endpoint is called.

With GraphQL the Creator outsources the what query to write part directly to the consumer of the API, imagine if you had the ability to write SQL queries directly on the frontend!. Of cause doing that is dangerous but that's where GraphQL steps in to allow this in a safe way.

--

--