I started my job search about a month ago after graduating from Flatiron School on April 2021. Looking at the different job postings, I noticed that a lot of companies had graphQl in their requirements so I decided to start learning it.

What is graphQL?

It is a query language for reading and mutating data in apis.

GraphQL vs Rest

Traditionally, web developers have consumed apis using rest where data entities live on a bunch of urls on a server. When a request is received, the api responds with the full data payload of that entity. In this case, there are two potential drawbacks:

  • we may only want a small subset of a data entity, in which case we need to over fetch from the api which is bad for the environment.

Defining a schema

We can start defining a schema with our own custom objects using the type keyword. A type can have multiple fields like a unique id which we make required with a bang (!). We can also give it integer and string values then create a relationship with another type. A creator can have many videos which we represent by wrapping the type in brackets. On the other side, a video belongs to a creator as shown below

Example of a youtuber having videos
query type and mutation type

Who’s using GraphQL?

Facebook’s mobile apps have been powered by GraphQL since 2012. A GraphQL spec was open sourced in 2015 and is now available in many environments and used by teams of all sizes.

Why using GraphQL?

GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

French guy who recently moved to the United States. I am also changing career after having worked 13 years in restaurants. I will be going into coding.