title: Use the same class as Input and Object type in GraphQL in NestJS
body: <p>I am trying to setup my graphql resover to handle an array of objects but cant get the @Args  decorator configured.</p>
  <p>I created my own ArgsType</p>
  <pre><code>import { ArgsType, Field, Int, ObjectType } from '@nestjs/graphql';
  
  @ArgsType()  // to be used as type in the resolver
  @ObjectType()  // for schema generation 
  export class Club {
   @Field(type =&gt; String)
   president: string;
  
   @Field(type =&gt; Int)
   members?: number;
  }
  </code></pre>
  <p>Resolver with adding a single Club works just fine!</p>
  <pre><code> @Query(() =&gt; Int)
   async addClub(@Args() club: Club) {
    // handle stuff
    }
  </code></pre>
  <p>but if I want to give an array of Club like this</p>
  <pre><code> @Query(() =&gt; Int)
     async addClubs(@Args({name: 'clubs', type: () =&gt; [Club]}) clubs: Array&lt;Club&gt;) {
     // handle stuff
    }
  </code></pre>
  <p>this thows an error when nest is starting up</p>
  <pre><code> UnhandledPromiseRejectionWarning: Error: Cannot determine a GraphQL input type for the &quot;clubs&quot;. Make sure your class is decorated with an appropriate decorator.
  </code></pre>
  <p>although I am able to use an  array of Strings like this</p>
  <pre><code> @Query(() =&gt; [String])
   async addStrings(@Args({ name: 'clubs', type: () =&gt; [String], }) clubs: Array&lt;string&gt;) {
    // handle stuff
    }
  </code></pre>
  <p>I am pretty sure there should be an easy solution, but cant figure out where to go from here.</p>