title: GraphQL query with multiple nested resolvers and mapping fields to arguments
body: <p>From GraphQL Client's perspective, how do I perform a query with multiple nested resolvers where the fields from the parent are passed as arguments to the child resolver?</p>
  <p>Here is a minimal example:</p>
  <h3>GraphQL Schema:</h3>
  <pre><code>type Author {
    id: ID!
    name: String!
  }
  
  type Book {
    id: ID!
    title: String!
    releaseDate: String!
  }
  
  
  type Query {
    // Returns a list of Authors ordered by name, 'first' indicates how many entries to return
    getAllAuthors(first: Int!): [Author]!
    // Returns a list of Books ordered by releaseDate, 'first' indicates how many entries to return
    getBooksByAuthorId(first: Int! authorId: ID!): [Book]!
  }
  </code></pre>
  <p>Is it possible to write a query to get all authors and their last released book? Something around the lines:</p>
  <pre><code>query GetAuthorsWithLastBook($first: Int!) {
    getAllAuthors(first: $first) {
      authorId: id
      name
      lastBook: getBooksByAuthor(1, authorId) {
        title
      }
    }
  }
  </code></pre>
  <p>In the example above, I attempted to alias <code>getAllAuthors.id</code> as <code>authorId</code> and pass the alias down as argument to <code>getBooksByAuthor(...)</code> but that didn't work.</p>
  <p>The key aspect of the problem is that I don't know the <code>authorId</code>s beforehand. I could fetch the authors first and build a query to fetch their last book but that will result in multiple queries and that is something I would like to avoid.</p>
  <h2>Update</h2>
  <p>A Java Kickstarter example is available here: <a href="https://www.graphql-java-kickstart.com/tools/schema-definition/" rel="nofollow noreferrer">https://www.graphql-java-kickstart.com/tools/schema-definition/</a></p>