The What, Why, and How of GraphQL

Truong Hoang Dung
1 min readAug 8, 2018

--

I’m learning GraphQL and still researching on how to get the most out of it.

What ?

There’s one nice benefit that i could see when i use GraphQL in my program.

The ability to abstract out Database Layer from programs on the process level. Or, putting in another way, you don’t even know SQL to design or manage your data.

Let me clarify this.

  • Programs: This is your code, maybe on server, maybe on client, or maybe a command line program, whatever your code is.
  • Database layer: Where you store your state, or, your data storage. It also includes everything which belongs to database: sql code, driver code in your programming language, or it could be a NoSQL database. The layer also includes database migrations which you have to manage, which might be written using sql code, or your programming language.

Why ?

Because the logic of querying a list of users is the same for both client and server, or the logic of accessing a list of users is not different from client and server viewpoints.

How ?

Simply speaking, you just use only one language to do that: GraphQL Query Language.

For example, you could use Hasura for your web server, apollo-client for your web client, both will help you do that.

Learn it from now and get more benefits tomorrow !

--

--