GraphQL — Basic

Soumitya Chauhan
2 min readJun 19, 2023

--

History —
Released in 2015 by Facebook, GraphQL has offered a new, promising alternative to the traditional REST API. Since then, many companies, including GitHub, Shopify, and Intuit, have adopted GraphQL into their ecosystems.

Intro —
GraphQL or “Graph Query Language” is, just as the name suggests, a query language for APIs.
While SQL is a query language for managing relational databases.
GraphQL is a way for clients (like web or mobile applications) to communicate with servers and retrieve data. GraphQL allows clients to request specific data from the server, getting exactly what they need and avoiding unnecessary information.

Advantages of GraphQL —
One endpoint: With traditional REST APIs, you have to create specific endpoints based on the data you want to request. You might find yourself having to manage tens, maybe hundreds, of routes that you will have to remember. So Instead of using multiple endpoints like in traditional APIs, GraphQL has a single endpoint where clients can send their requests.

Declarative data fetching: Unlike a REST API, GraphQL only fetches what you actually need. All you have to do is specify what fields to return.

Self-documenting: GraphQL is self-documenting, meaning that all of your queries and mutations will automatically be documented by GraphQL.

Basic components of GraphQL —
1. Schema [Click Me!]
2. Query
3. Mutation

Summary —
Released in 2015 by Facebook, GraphQL. GraphQL is a way for clients (like web or mobile applications) to communicate with servers and retrieve data.GraphQL has a single endpoint where clients can send their requests.
GraphQL allows clients to request specific data from the server, getting exactly what they need and avoiding unnecessary information.

--

--