title: Cannot read property 'save' of undefined
body: <p>I am using GraphQL along with NodeJs and Mongoose (I guess GraphQL won't matter here) </p>
  
  <p>When I run my Query, <strong>I am getting a message saying cannot read property <code>save</code> of undefined.</strong> </p>
  
  <pre><code>      resolve (parent, args) {
          let books
          book.find(
              {
              name: args.name
              }, function (error, result){
                  console.log(result.length)
                  if (result.length == 0) { 
  
                      console.log(args.name)
                      books = new book({
                          name: args.name, 
                          genre: args.genre,
                          authorName: args.authorName
                      })    
                      Author.find(
                          {
                          name: args.authorName
                          },
                          function (err, results) {
                              if (results.length == 0) {
                                  let author = new Author({ 
                                      name: args.authorName
                                  })
                              author.save()
                          }
                          });
                  }
              })
                  return books.save()
          }
  </code></pre>
  
  <p>This is my code, above notice the two console.log. The first console.log shows the length to be zero and the second console.log does have a value in it </p>
  
  <p>Also, Author and book is a mongoose schema which I am importing</p>
  
  <pre><code>const Author = require("../models/author.js")
  const book = require("../models/book.js")
  </code></pre>
  
  <p>I declared <code>let books</code> just below the <code>resolve (parent, args) {</code> for the sake of scope. </p>
  
  <p><strong>Question:</strong> Now, I don't have much of experience with JS so can someone help me and share what I am doing wrong here?</p>