The power of GraphQL: why we often choose this technology anyway

While GraphQL continues to grow in popularity, more and more developers are also countering with drawbacks to this technology that simplifies communication between front and backend.

  • Linda

Written by Linda

As developers, we are constantly faced with the challenge of choosing the best technologies to suit our projects. In this blog article, we would like to share the reasons why we often choose to use GraphQL in our projects. Even though disadvantages of GraphQL are regularly highlighted, there are several factors that convince us to embrace this technology (with great regularity). Now if you have no idea what GraphQL is exactly, here you will find some general information.

Why you shouldn't choose GraphQL

Lately, we have been seeing more and more emphasis on the drawbacks of GraphQL, which we actually see as a good thing. With techniques you use, it is always wise to consider whether one or the other is really the best solution to a problem.

One of the disadvantages that is often mentioned is versioning. Basically, you run 1 version of GraphQL, where with other APIs (e.g. based on REST) it is possible to have multiple versions. This can mainly cause problems with mobile applications where it remains to be seen whether all users regularly update their apps (and you therefore want to be sure that an older version continues to work). However, since the APIs of our projects are usually not aimed at public use, or mainly consist of web applications, we suffer significantly less from this drawback. Moreover, it makes continuous development of these web applications a lot easier.

Another disadvantage often mentioned is that GraphQL can disclose too much information (too much exposing). If you don't think carefully about your database architecture and configuration of GraphQL, too much information may be passed from the database and sensitive information may suddenly be out in the open. Of course, we are aware of the importance of that proper configuration. What also helps is that we often work on internally authenticated applications. Then information is already extensively protected at an earlier level, even before a query is executed.

Why you should choose GraphQL

Besides the disadvantages mentioned, GraphQL also has major advantages that convince us to choose this technique. First of all, GraphQL provides an easy way to define types, which helps tremendously in maintaining a consistent data structure and minimising errors. In addition, GraphQL has a robust ecosystem with popular tools like NestJS, Apollo, Codegen and React, giving us a huge library of solutions to choose from when developing. This makes it easy to integrate and work more efficiently. Finally, we appreciate the flexibility GraphQL offers in separating the backend and frontend, while keeping both in one monorepo. This allows teams to work independently and in parallel, and we can coordinate changes in both layers simultaneously.

TL;DR

Despite the drawbacks that are often discussed, there are several reasons why we often choose GraphQL for our projects. Minimising version control, the benefits of easy typing and a flexible backend/frontend separation are all factors that convince us of the power of GraphQL as a technology choice for many of our projects. Of course, every project is different and GraphQL is less suitable for some projects, but so far we are fans!

Is GraphQL right for your project?

Want to know more about GraphQL and how it can improve your projects? Contact us to find out how we can help you implement GraphQL.