title: How to properly add return type to aws-sdk DynamoDb Send command
body: <p>I am trying to get a generic type back as part of my OutputType when I do a DynamoDB Get using the new v3 aws-sdk.</p>
  <p>My function looks like:</p>
  <pre><code>public async getItem&lt;T&gt;(data: GetItemCommandInput) {
    const command = new GetItemCommand({
      ...data
    });
    return await this.dbClient.send&lt;GetItemCommand, T&gt;(command);
  }
  </code></pre>
  <p>Typescript is not happy with putting the T in the Send call. Looking at the typescript definition, it is pretty messy and I don't understand what they are doing.
  The first Type <code>Send</code> expects is of type <code>ClientInput</code>, and the second one of <code>ClientOutput</code>.
  Looking at the definition of <code>ClientOutput</code> my jaw just drops open:</p>
  <pre><code>ClientOutput extends MetadataBearer, ResolvedClientConfiguration extends SmithyResolvedConfiguration&lt;HandlerOptions&gt;&gt; implements IClient&lt;ClientInput, ClientOutput, ResolvedClientConfiguration&gt;
  </code></pre>
  <p>....okay, they lost me.</p>
  <p>Normally I would expect something like:</p>
  <pre><code> await this.dbClient.send&lt;GetItemCommandInput, T&gt;(command);
  or 
  return await this.dbClient.send&lt;GetItemCommandInput, GetItemCommandOutput&lt;LegalAccount&gt;&gt;(command);
  </code></pre>
  <p>but <code>GetItemCommandOutput</code> doesn't allow for a generic.</p>
  <p>Looking at the source typing I see:</p>
  <pre><code>export interface GetItemOutput {
      /**
       * &lt;p&gt;A map of attribute names to &lt;code&gt;AttributeValue&lt;/code&gt; objects, as specified
       *             by &lt;code&gt;ProjectionExpression&lt;/code&gt;.&lt;/p&gt;
       */
      Item?: {
          [key: string]: AttributeValue;
      };
  </code></pre>
  <p>My whole point is that when I get the result of the query, I know that the Item inside the output is of type T.
  Did AWS just forget this or am I missing something. Docs are totally NOT helpful as expected :(</p>