title: Using graphql union return an array with some empty objects
body: <p>I'm using graphql union - <code>union FolderOrFile = Folder | File</code>. When I query for only folders I get array containing folder objects with empty objects that are basically the file objects.</p>
  
  <p>TypeDefs</p>
  
  <pre><code>const typeDefs = gql`
      union FolderOrFile = Folder | File
      type Folder {
          name: String
          path: String
          type: String
          children: [FolderOrFile]
      }
      type File {
          name: String
          path: String
          content: String
          type: String
          size: Int
          ext: String
          createdAt: String
      }
      type Query {
          folders: Folder
      }
  `
  </code></pre>
  
  <p>Resolvers</p>
  
  <pre><code>const resolvers = {
      FolderOrFile: {
          __resolveType: obj =&gt; {
              if (obj.type === "file") {
                  return 'File'
              }
              if (obj.type === "folder") {
                  return 'Folder'
              }
          },
      },
      Query: {
          folders: async () =&gt; {
              const data = await folders
                  .getFolder('./filesystem')
                  .then(response =&gt; response)
              const appendData = await {
                  name: 'Folder',
                  path: './filesystem',
                  type: 'folder',
                  children: data,
              }
              return appendData
          }
      }
  }
  </code></pre>
  
  <p><code>folders</code> query</p>
  
  <pre><code>{
    folders {
      name
      path
      type
      children {
        ... on Folder {
          name
          path
          type
          children {
            ... on Folder {
              name
              path
              type
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Response I get</p>
  
  <pre><code>{
    "data": {
      "folders": {
        "name": "Folder",
        "path": "./filesystem",
        "type": "folder",
        "children": [
          {
            "name": "Dishes",
            "path": "./filesystem/Dishes",
            "type": "folder",
            "children": [
              {},
              {},
              {
                "name": "Non Vegetarian",
                "path": "./filesystem/Dishes/Non Vegetarian",
                "type": "folder"
              },
              {
                "name": "Vegetarian",
                "path": "./filesystem/Dishes/Vegetarian",
                "type": "folder"
              }
            ]
          },
        ]
      }
    }
  }
  </code></pre>
  
  <p>The response shouldn't have those empty objects which in this case is for files being returned as empty object. Similarly when I query for file I get folders as empty objects.</p>