title: Why is Laravel Lighthouse GraphQL running multiple MySQL queries (not eager loading)?
body: <p>I am new to GraphQL and Lighthouse.</p>
  <p>My understanding from <a href="https://lighthouse-php.com/4.0/performance/n-plus-one.html#eager-loading-relationships" rel="nofollow noreferrer">https://lighthouse-php.com/4.0/performance/n-plus-one.html#eager-loading-relationships</a> is that for a nested GraphQL query, &quot;Under the hood, Lighthouse will batch the relationship queries together in a single database query.&quot;</p>
  <p>However, I see in the logs all of these queries where there should be only 1:</p>
  <pre><code>select count(*) as aggregate from `posts`
  select * from `posts` order by `created_at` asc limit 20 offset 0
  select * from `post_files` where `post_files`.`post_id` in (249, 5...
  select * from `post_tags` where `post_tags`.`post_id` in (249, 5...
  select * from `comments` where `comments`.`post_id` in (249, 5...
  select * from `files` where `files`.`id` in (269, 615, ...
  select * from `tags` where `tags`.`id` in (2, 3, 4, ...
  </code></pre>
  <p>Here is my GraphQL query:</p>
  <pre><code>gql`
      query Posts($page: Int) {
          posts(
              first: 20
              page: $page,            
              orderBy: { field: CREATED_AT, order: ASC }
          ) {
              paginatorInfo {
                  currentPage
                  hasMorePages
                  total
              }
              data {
                  id
                  content 
                  created_at
                  postFiles {
                      file {
                          id
                          original_name 
                          extension
                      }
                  }
                  postTags {
                      id
                      tag {
                          id
                          label 
                      }
                  }
                  comments {
                      id
                      user_id
                      message 
                      created_at
                      seen_at
                  }
              }
          }
      }
  `;
  </code></pre>
  <p>My schema.graphql has the right <code>@belongsTo</code> and <code>@hasMany</code> directives:</p>
  <pre><code>&quot;A date string with format `Y-m-d`, e.g. `2011-05-23`.&quot;
  scalar Date @scalar(class: &quot;Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Date&quot;)
  
  &quot;A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`.&quot;
  scalar DateTime
      @scalar(class: &quot;Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime&quot;)
  
  &quot;A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`.&quot;
  scalar DateTimeTz
      @scalar(class: &quot;Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz&quot;)
  
  type Comment {
      id: Int!
      user: User! @belongsTo
      user_id: Int!
      post: Post! @belongsTo
      post_id: Int!
      message: String!
      emailed_at: DateTime
      seen_at: DateTime
      created_at: DateTime!
      modified_at: DateTime!
  }
  
  type File {
      id: Int!
      original_name: String!
      extension: String!
      postFiles: [PostFile!]! @hasMany
  }
  
  type Post {
      id: Int!
      user: User! @belongsTo
      user_id: Int!
      content: String
      origin: String
      created_at: DateTime!
      modified_at: DateTime!
      postFiles: [PostFile!]! @hasMany
      comments: [Comment!]! @hasMany
      postTags: [PostTag!]! @hasMany
  }
  
  type PostFile {
      post: Post! @belongsTo
      post_id: Int!
      file: File! @belongsTo
      file_id: Int!
  }
  
  type PostTag {
      id: Int!
      post: Post! @belongsTo
      post_id: Int!
      tag: Tag! @belongsTo
      tag_id: Int!
      created_at: DateTime!
      modified_at: DateTime!
  }
  
  type Tag {
      id: Int!
      label: String!
      hash: String!
      created_at: DateTime!
      modified_at: DateTime!
      postTags: [PostTag!]! @hasMany
  }
  
  type User {
      id: Int!
      email: String!
      password: String!
      salt: String
      db_key: String
      created_at: DateTime!
      modified_at: DateTime!
      posts: [Post!]! @hasMany
      comments: [Comment!]! @hasMany
  }
  
  type Query {
      comments: [Comment!]! @all
      files: [File!]! @all    
      posts(
          orderBy: _ @orderBy(columns: [&quot;id&quot;, &quot;created_at&quot;], order: ASC)
      ): [Post!]! @paginate(defaultCount: 20)
      post(id: ID! @eq): Post @find
      postFiles: [PostFile!]! @all
      postTags: [PostTag!]! @all
      tags: [Tag!]! @all
      users: [User!]! @all
  }
  
  </code></pre>
  <p>My Laravel models have all the right relationships. E.g. class Post has:</p>
  <pre><code>public function comments() {
      return $this-&gt;hasMany(Comment::class, Comment::POST_ID);
  }
  </code></pre>
  <p>And class Comment has:</p>
  <pre><code> public function post() {
      return $this-&gt;belongsTo(Post::class); 
   }
  </code></pre>
  <p>and so on.</p>