title: How to get an array or list as result from a graphql query?
body: <p>Hello I am new to graphql and I was wondering if it is possible to create a root query in my schema that will return an array or list as a result. </p>
  
  <p>To be more precise I have created the following type in my schema:</p>
  
  <pre><code>const ResourceType = new GraphQLObjectType({
    name:'Resource',
    fields:()=&gt;({
     id: {type: GraphQLID},
     url: {type: GraphQLString},
     title: {type: GraphQLString},
     author: {type: GraphQLString},
     license:{type: GraphQLString},
     LicenseScore: {type: GraphQLFloat},
   })
  });
  </code></pre>
  
  <p>And I want to query all the resources in my database so that I get their license type and then assign a score according to the license. Is it possible to have a query that gets the license for each resource and returns an array like this: [[id:1209,score:3.5],[1203,4.5]....]? </p>
  
  <p>I have created a mutation that updates the score to the database, here it is:</p>
  
  <pre><code>updateAllLicenses: {
       type: new GraphQLList(ResourceType),
       async resolve(parent,args){
       var licns;
       var scr;
       await Resource.find({}).then(async function(results){
         var num = results.length;
         var scr=0;
         for (var i=0; i&lt;num; i++){
           if (! (results[i].license in licenseScores)){
             scr = 0;
           }
           else{
             scr = licenseScores[results[i].license];
           }
           await Resource.findByIdAndUpdate(results[i].id{LicenseScore:scr});
          }
        });
        return await Resource.find({});
      }
     }
  </code></pre>
  
  <p>However I was wondering if there is a way to get these scores directly from the query instead of saving them in the database. I tried changing the type to new GraphQLList(GraphQLFloat) and returning an array with the scr values but I get an error in the graphql api saying I have the wrong output type in my mutation.</p>