Subscriptions aren't adaptable enough.
See original GitHub issueI’m submitting a…
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behaviour
It is not possible to use this
in the subscription resolve function. This makes it incredibly hard to use services to retrieve information from given information.
https://objects.black-out.xyz/a0f6d2b https://objects.black-out.xyz/200c4ce Some screenshots of the current behaviour ^
The code I had when using type-graphql
https://objects.black-out.xyz/3172643
Expected behavior
The ability to use this
or services in the subscription resolve function. type-graphql
didn’t force an async iterator to be returned so it was very easy to use add the equivalent of a resolve
function in the actual function.
Minimal reproduction of the problem with instructions
- Create a resolver.
- Inject a service into the resolver.
- Create a subscription and attempt to use the service in the
resolve function
.
It could look something like https://objects.black-out.xyz/a4cef78
What is the motivation / use case for changing the behavior?
The current behaviour isn’t adaptable enough to build bigger graphql apps compared to things like type-graphql
I did spend quite some time with a member of the discord and neither of us could think of any workarounds.
There might be a nice way to do it with DI but I’m not aware.
Environment
Nest version: 6.2.4
Nest GraphQL version: 6.4.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:14 (2 by maintainers)
hey - im experiencing the same issue right now, is there any eta for when this will be fixed
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.