title: NestJS Gateway dependency injection
body: <p>I have a service called &quot;PlayerService&quot; and the gateway calls &quot;Player Gateway&quot;, the PlayersGateway has dependency of PlayerService, but I can't inject o service inside gateway.</p>
  <p><strong>PlayerGateway</strong></p>
  <pre><code>@UseInterceptors(RedisPropagatorInterceptor)
  @WebSocketGateway()
  @Injectable()
  export class PlayerGateway
    extends BaseGateway
    implements OnGatewayConnection, OnGatewayInit, OnGatewayDisconnect {
  
  constructor(private playerService: PlayerService) {
      super();
    }
  </code></pre>
  <p><strong>PlayerService</strong></p>
  <pre><code>@Injectable()
  export class PlayerService extends BaseService&lt;Player&gt; {
    protected fieldsSearchable: FieldsSearchable = {};
  
    private logger = new Logger('PlayerService');
  
    constructor(
      @InjectRepository(PlayerRepository)
      repository: PlayerRepository,
      @Inject(REQUEST) protected request: Request,
      private redisService: RedisService,
    ) {
      super();
      this.setRepository(repository);
    }
  </code></pre>
  <p><strong>PlayerModule</strong></p>
  <pre><code>@Module({
    imports: [
      TypeOrmModule.forFeature([Player, PlayerRepository]),
      RedisModule,
      SocketModule,
      RedisPropagatorModule,
    ],
    controllers: [PlayerController],
    exports: [TypeOrmModule, PlayerService],
    providers: [PlayerService, PlayerGateway],
  })
  export class PlayerModule {}
  </code></pre>
  <p><strong>Modules.ts</strong></p>
  <pre><code>@Module({
    imports: [
      RedisModule,
      SocketModule,
      RedisPropagatorModule,
      SessionModule,
      PlayerModule,
    ],
    exports: [RedisModule, SocketModule],
    controllers: [],
    providers: [ServerGateway, NetworkGateway],
  })
  </code></pre>
  <p>What I want to know is how can I inject the service inside gateway or a way to make something like this rsrs</p>