title: GraphQL mutation type missing in the response
body: <p>I built in my GraphQL API a <code>DeleteUserMutation</code> which should allow me to delete a user and have a response with a message but on the return, I'm getting an error:</p>
  
  <pre><code>SError: ⨯ Unable to compile TypeScript:
  src/graphql/mutations/user/delete-user.ts:21:9 - error TS2740: Type '{ responseCode: number; message: string; user: any; }' is missing the following properties from type 'User': id, name, last_name, email, and 4 more.
  
  21         return response;
             ~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>I tried to achieve that when  a User is deleted and success in the response I see the message from my type <code>DeleteUserresponse</code></p>
  
  <pre><code>export const DeleteUserResponse = gql`
      type DeleteUserResponse {
          responseCode: Number!
          message: String!
          user: User
      }
  `;
  </code></pre>
  
  <p>The mutation should delete the user and if success shows the success values and if not shows the opposite and I tried in this way:</p>
  
  <pre><code>import { getRepository } from 'typeorm';
  import { Entities } from '../../../entities/entities';
  
  export const deleteUserMutation = {
      async deleteUser(_, { id }): Promise&lt;typeof user&gt; {
          const response = {
              responseCode: 500,
              message: 'Error, user not deleted',
              user: null,
          };
  
          const repository = getRepository(Entities.user);
          const user = await repository.findOne({ id });
  
          if (user &amp;&amp; repository.delete({ id })) {
              response.responseCode = 200;
              response.message = 'User deleted successfully';
              response.user = user;
          }
  
          return response;
      },
  };
  </code></pre>
  
  <p>But this above doesn't work and cannot understand what is the issue as I'm a newbie in GraphQL.
  The error suggests the types are missing but I tried to play around adding and removing types but that error is not going away.</p>
  
  <p>What is the issue in my code and how to fix it.</p>