Resolvers are a very important part of your GraphQL application, as they are the ones that translate GraphQL requests or responses to whatever the data sources understand. To connect a GraphQL implementation to the data sources, you need to write resolvers. The data sources can be anything from NoSQL databases, relational databases, and HTTP servers to whatever returns data. GraphQL is implemented between the client and the data sources, making GraphQL a single entry point to the backend. The client can also specify attributes for the types it wants so that there is no over fetch of information. The client can call an operation with one request, which will return multiple types if needed so that there is no under fetch of information.
Here, all possible types of operations that the client can perform on the backend are defined. Between the client and the server, a contract is signed, called the GraphQL schema. GraphQL has some important characteristics. The client might end up getting a lot of information back that isn’t necessary (over fetch) and often forces him to do a lot of calls to the backend to populate a view since one request only brings part of the information necessary (under fetch). Usually, he needs to be familiar with all the information beforehand to be able to request the information from the server. When connecting to an endpoint, the client needs to specify headers, an HTTP method (GET, POST, DELETE, etc.), a body, and all kinds of parameters. In general, we are used to REST, where the client connects to the backend via a defined endpoint. GraphQL is a different way to connect your client applications to your backend.