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?

As a back-end developer, graphQL provides a type system where you can describe a schema for your data and in turn, this gives front-end consumers of the apis the power to explore and request the exact data they need.

GraphQL vs Rest

  • we may need multiple entities at one time, in which case, each request is under fetching the actual data we want.
  • 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.

Instead of multiple urls, a graphQL api has a single entry point. Data is queried or fetched by describing it with a syntax that mirrors its return shape in json. The front-end developers describe the data they want while the back-end developer writes code to resolve the request. And it all happens in a syntax that can work with any programming language.

Defining a schema

Example of a youtuber having videos

Every graphQL api has a query type which is the main entry point for a consumer of the api. We can query a list of videos or an individual user based on their id. That’s how a consumer reads data, but they may also want you to mutate data, in which case, we implement a mutation type that defines how data can be modified on the api.

query type and mutation type

From there, we can define code to resolve this data in any programming language. Once deployed, any developer consuming this api will be able to explore it with a complete understanding of all possible queries and data entities, which means the tooling can autocomplete the query as you type it out in the editor.

Who’s using GraphQL?

Why using GraphQL?

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.