Not every object that has a subscribe
method is an observable
#8595
Labels
needs triage
This issue has not been looked into
subscribe
method is an observable
#8595
Is there an existing issue for this?
Current behavior
Code assumes results are observables based on the presence of a subscribe method
Minimum reproduction code
https://github.com/nestjs/nest/blob/master/packages/core/helpers/external-context-creator.ts#L332
Steps to reproduce
In our case we returned an AsyncIterator for a graphql subscription. The returned object had a private subscribe method and nest just assumed it was an observable.
Expected behavior
Code doesn't check for presence of a method to call a completely different method
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
No response
Packages versions
(current version should also be affected)
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: