title: Implementing GraphQL Global Object Identification in NestJS (code-first approach)
body: <p>I am trying to implement Global Object Identification described in GraphQL's <a href="https://graphql.org/learn/global-object-identification/" rel="nofollow noreferrer">documentation</a> in NestJS.</p>
  <p><strong>1.) I started by creating a <code>Node</code> interface:</strong></p>
  <pre><code>import { ID, InterfaceType, Field } from '@nestjs/graphql'
  
  @InterfaceType()
  export abstract class Node {
      @Field(type =&gt; ID)
      id: number
  }
  </code></pre>
  <p><strong>2.) I implemented it in my model:</strong></p>
  <pre><code>import { Table } from &quot;sequelize-typescript&quot;;
  import { ObjectType } from &quot;@nestjs/graphql&quot;;
  import { Node } from &quot;src/node/node-interface&quot;;
  
  @ObjectType({
      implements: Node
  })
  @Table
  export class User extends Model {
  // [Class body here...]
  }
  </code></pre>
  <p><strong>3.) Then I created a Query that would return users:</strong></p>
  <pre><code>import { Resolver, Query} from &quot;@nestjs/graphql&quot;;
  import { User } from &quot;./user-model&quot;;
  
  @Resolver(of =&gt; User)
  export class UserResolver {
  
      @Query(returns =&gt; [Node])
      async users() {
          let users = await User.findAll();
          console.log(users);
          return users;
      }
  }
  </code></pre>
  <p><strong>4.) Then I performed the test query from the documentation:</strong></p>
  <pre><code>{
    __schema {
      queryType {
        fields {
          name
          type {
            name
            kind
          }
          args {
            name
            type {
              kind
              ofType {
                name
                kind
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  <p><strong>5.) But instead of receiving the proper response:</strong></p>
  <pre><code>{
    &quot;__schema&quot;: {
      &quot;queryType&quot;: {
        &quot;fields&quot;: [
          // This array may have other entries
          {
            &quot;name&quot;: &quot;node&quot;,
            &quot;type&quot;: {
              &quot;name&quot;: &quot;Node&quot;,
              &quot;kind&quot;: &quot;INTERFACE&quot;
            },
            &quot;args&quot;: [
              {
                &quot;name&quot;: &quot;id&quot;,
                &quot;type&quot;: {
                  &quot;kind&quot;: &quot;NON_NULL&quot;,
                  &quot;ofType&quot;: {
                    &quot;name&quot;: &quot;ID&quot;,
                    &quot;kind&quot;: &quot;SCALAR&quot;
                  }
                }
              }
            ]
          }
        ]
      }
    }
  }
  </code></pre>
  <p><strong>6.) I get this:</strong></p>
  <pre><code>{
    &quot;data&quot;: {
      &quot;__schema&quot;: {
        &quot;queryType&quot;: {
          &quot;fields&quot;: [
            {
              &quot;name&quot;: &quot;users&quot;,
              &quot;type&quot;: {
                &quot;name&quot;: null,
                &quot;kind&quot;: &quot;NON_NULL&quot;
              },
              &quot;args&quot;: []
            }
          ]
        }
      }
    }
  }
  </code></pre>
  <p>I have no clue what I am doing wrong. I'd appreciate any help with this.</p>