title: Getting null for async/await call in TypeScript
body: <p>Login function</p>
  <pre><code>async login(loginInput: LoginInput): Promise&lt;Login | null&gt; {
    if (!loginInput || !loginInput.email || !loginInput.password) return null;
  
    try {
      const user = await this.userService.validateUser({
        email: loginInput.email,
        password: loginInput.password,
      });
      var login: Login = new Login();
      login.accessToken = user.id; //test
      login.refreshToken = user.email; //test
      return login;
    } catch (err) {
      return null;
    }
  }
  </code></pre>
  <p>Fetch functions</p>
  <pre><code>  async validateUser(
      input: ValidateUserInput,
    ): Promise&lt;ValidateUserModel | null&gt; {
      const query: string = `query validateUser { validateUser(email: &quot;E1&quot;, password: &quot;P1&quot;), {id, email} }`; //test
      var user = await this.fetchData(this.url, query);
      return Promise.resolve(new ValidateUserModel(user.id, user.email));
    }
  
    async fetchData(url: string, query: string): Promise&lt;any&gt; {
      const res = fetch(url, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ query: query }),
      }).then((res) =&gt; res.json());
    }
  </code></pre>
  <p>Query</p>
  <pre><code>  @Query(() =&gt; Login, {nullable: true})
    async login(@Args('login') loginInput: LoginInput) {
      return await this.loginService.login(loginInput);
    }
  </code></pre>
  <p>Error</p>
  <pre><code>{
    &quot;data&quot;: {
      &quot;login&quot;: null
    }
  }
  </code></pre>
  <p>I'm getting the null result even if the login data is correct and I belive that this is because of the async/await incorrect usage. But I do not know what I'm doing wrong :(</p>
  <p><strong>Can you please help me to correct my code?</strong></p>