title: Trying to update password (GraphQL) "data must be a string and salt must either be a salt string"
body: <p>I'm new to graphQL and I'm trying to update the user profile password in the backend under my resolvers.js file but I've been stuck at it for a while and I keep getting the same error message. </p>
  
  <p><a href="https://i.stack.imgur.com/IUkZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IUkZ8.png" alt="enter image description here"></a></p>
  
  <p><strong>resolvers.js</strong></p>
  
  <pre><code>updatePassword: combineResolvers(
    isAuthenticated,
    async (parent, args, context) =&gt; {
      const { id, newPassword, oldPassword } = args;
      const { models, user, jwtSecret } = context;
  
      await models.User.updatePassword(
        { id, newPassword, oldPassword },
        createToken({ newPassword }, jwtSecret, API_TIMEOUTS.JWT_TOKEN),
        user.emailAddress
      );
  
      return models.User.findByEmail(user.emailAddress);
    }
  )
  </code></pre>
  
  <p><strong>Index.js (helper)</strong></p>
  
  <pre><code> const generatePasswordHash = async password =&gt; {
        const saltRounds = 10;
        return bcrypt.hash(password, saltRounds);
      }
  
    User.updatePassword = async (newPassword, emailAddress) =&gt; {
      const password = await generatePasswordHash(newPassword);
  
          return User.update(
              { password, resetPasswordToken: null },
              {
                  where: {
                      emailAddress
                  }
              }
          );
      };
  </code></pre>
  
  <p>Error that I'm getting</p>
  
  <p><em>"data must be a string and salt must either be a salt string or a number of rounds"</em></p>