https://embed.notionlytics.com/wt/ZXlKd1lXZGxTV1FpT2lKbVptRXhNemc1Wm1KbE1EUTBNakJoWVdNd05qaGhPRFl4T1RrNVptVXdZeUlzSW5kdmNtdHpjR0ZqWlZSeVlXTnJaWEpKWkNJNklrbGpiM1pzV2pOcU1VUnBRM1ZUUm1WNFRtdHlJbjA9

When developing software applications, mostly development consists of 2 parts: front-end development & back-end development. Connecting these general areas together is another whole important concept, better known as APIs.

What is an API?

An API, or application programming interface, is a set of rules that define how applications or devices can connect and communicate with each other. APIs exchange commands and data, and this requires clear protocols and architectures.

What problems does the REST have?

REST API is centered around individual endpoints, so to collect all needed data, a developer has to combine multiple endpoints. REST API approach problems are:

To solve these problems, GraphQL was introduced, which is the preferable way of building APIs nowadays.

What's GraphQL?

GraphQL is a query language and server-side runtime for application programming interfaces (APIs) that prioritizes giving clients exactly the data they request and no more, unlike other API building methods: REST which depends on endpoints, thus not having the ability to fetch ONLY needed data.

excaliQRAPH3.png

functioning

Why do we use GraphQL instead of REST?

GraphQL came to solve the problems REST had, so with GraphQL:

  1. It gives us a single endpoint, no more creating new versions for the same API.