A brief introduction to GraphQL

A RESTful API is a de-facto standard to allow communication between applications, although, recently GraphQL comes up.
From the user-client perspective, GraphQL is similar to RESTful, they work as an entry point between different applications, but GraphQL is slightly different, and because of this, this technology has a reason to be.
GraphQL vs RESTful API
GraphQL and RESTful have the same foundation. They use the HTTP methods, and they have the idea of resource, but, in
REST, each endpoint is a single resource, while in GraphQL there is only a single resource.
GraphQL is not about resource state management, but about separating read operations (queries) from write operations
(mutations). This is known as
the Command Query Separation pattern.
In REST, the server determines the shape and size of a resource, in GraphQL depends on the user's needs.
How to manage a GraphQL schema?
A schema contains objects, every object has different parameters, and those parameters can be properties or even sub-objects.
Usually, if you want to filter an object(s) from a specific Type, you can apply a filter into brackets, the output is always a JSON response.
Queries
The queries are the GET requests. That means you can only fetch data.

Mutations
The mutations are the POST, PUT, PATCH, and DELETE HTTP methods. That means you can mutate the data model, and persist it in the database by creating, updating or removing elements.

In a mutation, the addOffer() is the instruction you will perform into the system, though the body of the mutation is the response you want to receive.
To write queries and mutations effectively, you need to understand the database architecture and relations between elements. Beyond that, GraphQL works similarly to REST, just with different syntax.

The GraphQL documentation covers more advanced topics like enums, interfaces, entity
management, and schema design. Worth checking out if you're building a GraphQL API from scratch.