Apollo Federation Type AssetAccount is an extension type, but there is no type definition Error

Am updating my nest js apollo federation and am getting this error.

/Users/leonlishenga/Documents/code/omnivoltaic/nest/microservices/microservices-apigateway/node_modules/@apollo/gateway/src/supergraphManagers/IntrospectAndCompose/index.ts:118
      throw Error(
            ^
Error: A valid schema couldn't be composed. The following composition errors were found:
        [accounts-microservice] Type "Distributor" is an extension type, but there is no type definition for "Distributor" in any subgraph.
        [accounts-microservice] Type "Item" is an extension type, but there is no type definition for "Item" in any subgraph.
        [accounts-microservice] Type "AssetAccount" is an extension type, but there is no type definition for "AssetAccount" in any subgraph.
        [accounts-microservice] Type "Person" is an extension type, but there is no type definition for "Person" in any subgraph.
        [accounts-microservice] Type "CreditAccount" is an extension type, but there is no type definition for "CreditAccount" in any subgraph.
    at IntrospectAndCompose.createSupergraphFromSubgraphList (/Users/leonlishenga/Documents/code/omnivoltaic/nest/microservices/microservices-apigateway/node_modules/@apollo/gateway/src/supergraphManagers/IntrospectAndCompose/index.ts:118:13)

This is how my schema looks for the Distributor entity class extension in the Account Microservice


@ObjectType()
@Directive('@extends')
@Directive('@key(fields: "_id")')
export class Distributor {
  @Field((type) => ID)
  @Directive('@external')
  _id: ObjectId;

  @Field((type) => [AssetAccount], { name: 'assetAccount', nullable: true })
  assetAccount?: AssetAccount;
}

In the service that owns the Distributor entity it looks like this


@ObjectType()
@Directive('@key(fields: "_id")')
export class Distributor extends Org {
  @Field((type) => PERMISSIONS, { nullable: true })
  public activeSubRolePermission: PERMISSIONS;

  @Field((type) => Roles, { name: 'role', nullable: true })
  public roleId?: ObjectId;
}

The Org that it extends to looks like this


@InterfaceType()
@Entity({ abstract: true })
export abstract class Org extends BaseEntity {
  // This is used for certain event consequenc
  @Field((type) => OrgTypes)
  @Enum({ items: () => OrgTypes, default: OrgTypes.DISTRIBUTOR })
  public type: OrgTypes;
  @Field()
  @Property({ default: 'OVES Distributor' })
  public name: string;
}

With the BaseEntity looking like this

@InterfaceType()
@Directive('@key(fields: "_id")')
export abstract class BaseEntity {
  @Field(() => ID)
  public _id!: ObjectId;
}

The gateway for the two subgraphs looks like this


@Module({
  imports: [
    GraphQLModule.forRoot<ApolloGatewayDriverConfig>({
      driver: ApolloGatewayDriver,
      server: {
        cors: true,
        context: ({ req }) => ({
          authorization: req.headers.authorization,
          universe: req.headers.universe,
        }),
      },
      gateway: {
        supergraphSdl: new IntrospectAndCompose({
          subgraphs: [
            {
              name: 'client-microservice',
              url: 'http://localhost:3001/graphql',
            },
            {
              name: 'accounts-microservice',
              url: 'http://localhost:3011/graphql',
            },
          ],
        }),
      },
    }),
  ],
})
export class AppModule {}

I have just taken a snapshot of two subgraphs i.e account-microservice and client-microservice. My question is this, what could be causing this error or issue? I can’t seem to solve it.

My Package.json for the gateway looks like this

{
  "dependencies": {
    "@apollo/gateway": "2.0.5",
    "@nestjs/apollo": "10.0.17",
    "@nestjs/common": "9.0.1",
    "@nestjs/core": "9.0.1",
    "@nestjs/graphql": "10.0.18",
    "apollo-server-express": "3.9.0",
    "graphql": "16.5.0",
    "graphql-tools": "8.3.0",
  },
}

Anyone who can help me with this I will appreciate it greatly.