After 8 years of developing Android applications, I decided to enlarge my skills and started to work on backend development.
I started by learning GraphQL on the server-side, then the problems started, how to make a maintainable project without complexifying too much the code?
In this series of 3 articles, I will try to show you:
GraphQL is an alternative to REST. Initially designed by Facebook in 2012; it is now open-source.
It provides a more intuitive way to perform complex queries to a server.
Unlike REST, you can ask for the exact resources you need.
This article is Part 2 over 3 articles.
In Part 1 of this article, we’ve created a small GraphQL server. We’ll now introduce Clean Architecture so the project will be easier to maintain.
Clean Architecture is not the easiest architecture. If you’re looking for an architecture for a small project, it’s probably not the best choice.
But if your project starts to become bigger (when the number of resolvers or the data sources is increasing or when you start to struggle unit testing your business logic) then Clean Architecture is what you’re looking for.
This article is the last part of 3 articles.
In Part 2 of this article; we’ve written a GraphQL server implemented using the Clean Architecture principles. We have also seen that Clean Architecture can be a bit verbose.
Let’s now rewrite our project using Functional Programming and see what are the benefits.
Most of us know what is Functional Programming: It’s an approach of programming that consists of using only functions.
But why? Classes are great and very common. So, why use only functions?
To understand what is a Pure function, I like this explanation by Tommi Kaikkonen