<story><title>Apollo Server 1.0  – GraphQL Server for Node.js Frameworks</title><url>https://dev-blog.apollodata.com/apollo-server-1-0-a-graphql-server-for-all-node-js-frameworks-2b37d3342f7c</url></story><parent_chain><item><author>danr4</author><text>Couldn&amp;#x27;t find if Apollo solves the database round trips issue with GraphQL (the joins&amp;#x2F;n+1 problem). Can anybody shed a light on it?</text></item></parent_chain><comment><author>sorenbs</author><text>There are basically two approaches to this issue:&lt;p&gt;0) Do nothing&lt;p&gt;If you are just prototyping, you should do the simplest thing that could possibly work. (But this is not a real solution, so I won&amp;#x27;t count it)&lt;p&gt;2) Request Batching&lt;p&gt;This approach is popularised by Facebooks Dataloader library &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;facebook&amp;#x2F;dataloader&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;facebook&amp;#x2F;dataloader&lt;/a&gt;
Instead of directly querying the database in the resolver, you return a specification of what data you are interested in. When all resolvers on the same level in the query has returned this specification, the Dataloader library figures out how to batch queries together as much as possible&lt;p&gt;3) Big Join&lt;p&gt;You can inspect the GraphQL query in the top level resolver and basically perform one giant join up front. You will then pass the entire value down your resolve hierarchy, and all they have to do is pick out the correct data from the complete result set. Take a look at join-monster if you are interested in this approach.&lt;p&gt;The Graphcool hosted backend is serving millions of requests an hour using the Dataloader approach, and we have found this to be more flexible and more performant at scale than generating a big complex join up front.&lt;p&gt;For most queries we see single digit millisecond response time for a batched query, and the time complexity scales linearly with the depth of the query, which is not the case for joins.</text></comment>
<story><title>Apollo Server 1.0  – GraphQL Server for Node.js Frameworks</title><url>https://dev-blog.apollodata.com/apollo-server-1-0-a-graphql-server-for-all-node-js-frameworks-2b37d3342f7c</url></story><parent_chain><item><author>danr4</author><text>Couldn&amp;#x27;t find if Apollo solves the database round trips issue with GraphQL (the joins&amp;#x2F;n+1 problem). Can anybody shed a light on it?</text></item></parent_chain><comment><author>tylerbainbridge</author><text>It does not-- we&amp;#x27;ve been using graphql intensively with relationship-heavy graph data and join-monster seems handle this gracefully.&lt;p&gt;join-monster.readthedocs.io</text></comment>