title: GraphQL nested query Lookup
body: <p>I am using graphql-tools for schema generation. This query works fine</p>
  
  <pre><code>query{
    links(id: 1) {
      url
      resources{
        type
        active
      }
    }
  }
  </code></pre>
  
  <p>My question is what the "resolver" will be for nested query so that it returns resource of 8902 id.</p>
  
  <pre><code>query{
    links(id: 1) {
      url
      resources(id: 8902) {
        type
        active
      }
    }
  }
  </code></pre>
  
  <p>Code is as follow:</p>
  
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const {graphqlExpress, graphiqlExpress} = require('apollo-server-express');
  const {makeExecutableSchema} = require('graphql-tools');
  const _ = require('lodash');
  
  const links = [
      {
          id: 1, url: "http://bit.com/xDerS",
          resources: [
              {id: 8901, type: "file", active: true, cacheable: true},
              {id: 8902, type: "file", active: false, cacheable: true}
          ]
      },
      {
          id: 2,
          url: "http://bit.com/aDeRe",
          resources: [{id: 8903, type: "file", active: true, cacheable: true}]
      }
  ];
  
  const typeDefs = `type Query { links(id: Int, ): [Link]} 
    type Link { id: Int, url: String, resources(id: Int): [Resource] }
    type Resource {id: Int, type: String, active: Boolean, cacheable: Boolean}`;
  
  const resolvers = {
      Query: {
          links: (root, arg, context) =&gt; {
              return arg == null ? links : _.filter(links, {id: arg.id});
          }
  
      }
  };
  
  const schema = makeExecutableSchema({typeDefs, resolvers});
  const app = express();
  app.use('/graphql', bodyParser.json(), graphqlExpress({schema}));
  app.use('/graphiql', graphiqlExpress({endpointURL: '/graphql'}));
  app.listen(3000, () =&gt; console.log('Go to http://localhost:3000/graphiql to run queries!'));
  </code></pre>