Graphql Federation Data Loader
Introduction While GraphQL federation enables team to collaborate on different subgraphs, a problem arises: how does a subgraph handle a N+1 queries problem? For example, in our previous post, if we have a list of products, each of which has multiple reviews, then it can lead to multiple queries in the Review subgraph as it needs to resolve reviews field for each Product entity one by one. In this post, we’ll explore a pattern called Data Loader, that’s often used in a federated GraphQL architecture to solve the N+1 queries problem....