title: graphql resolver return Cannot return null for non-nullable field from asynchronous function in nodejs
body: <p>Don't get me wrong I have been forced to use waterfall because I need to execute one function after another. There is no problem related to the schema or return type just stuck with asynchronous waterfall. All I need is to return from the final function not before.</p>
  <pre><code>const async = require('async')
  module.exports = {
  logout : ()=&gt;{
          return async.waterfall([
              callback =&gt; {
                  setTimeout(() =&gt; {
                      let data = 1;
                      return callback(null, data)
                  }, 2000);
              },
              (data, callback) =&gt; {
                  setTimeout(() =&gt; {
                      return callback(null, data+1)
                  }, 2000);
              }
              
          ], (err, res)=&gt;{
              console.log(res)
              return res
          })
      }
  }
  </code></pre>
  <p>response from graphiql because It returns early. And console.log is working</p>
  <pre><code>{
    &quot;errors&quot;: [
      {
        &quot;message&quot;: &quot;Cannot return null for non-nullable field RootMutation.logout.&quot;,
        &quot;locations&quot;: [
          {
            &quot;line&quot;: 4,
            &quot;column&quot;: 3
          }
        ],
        &quot;path&quot;: [
          &quot;logout&quot;
        ]
      }
    ],
    &quot;data&quot;: null
  }
  </code></pre>