Greetings! This is the fourth article of the GraphQL series and the second part of the Query where I am going to solve (N+1) problem in GraphQL. However, I will add complete codes as well to make it usable on its own. The complete code can be found here . Code with (N+1) problem unresolved is here . (N+1) in brief When we fetch relationships like we did in our movie server where we queried movies, there will be extra N queries to fetch the relationship (director). With the first query to find movies, there are (N+1) queries altogether. Had you run our example by adding a console.log you can see the problem clearly. export function findDirector(id) { console.log(`find director for {id}`); return directors.find(director => director.id === id); } This problem does not depend on the database we used. Whether it is a fake store like we use, MySql, or MongoDB, the problem is the same. Solving N+1 Facebook provides a solution for this using the library data-loa
May all beings be happy, be well, be peaceful, and be free