Subscription error
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] 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 behavior
{
"error": {
"message": "Subscription field must return Async Iterable. Received: { pubsub: { ee: [Object], subscriptions: {}, subIdCounter: 0 }, pullQueue: [], pushQueue: [], running: true, allSubscribed: null, eventsArray: [\"onCategory\"] }"
}
}
Expected behavior
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
@Subscription(() => [Category])
public onCategory() {
return pubSub.asyncIterator('onCategory');
}
Environment
Nest version: 6.8.2
For Tooling issues:
- Node version: v12.11.1
- Platform: macOS Catalina
Others:
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Angular 2 - Checking for server errors from subscribe
subscribe() method can take a third argument that is called on completion if there are no errors. For reference: [onNext] ( Function ):...
Read more >Fix problems with subscriptions - Android - Google Play Help
Find missing subscriptions If you can't find your subscriptions, check that you're signed in to the correct account. Make sure to sign in...
Read more >RxJs Error Handling: Complete Practical Guide
In this post, we will cover the following topics: The Observable contract and Error Handling; RxJs subscribe and error callbacks; The catchError ...
Read more >Subscription Error Message on Account Page
This error will be triggered whenever a user's subscription has become Inactive AND when their Auto-Rebill is set to Enabled.
Read more >We've run into a problem with your Microsoft 365 subscription
Provides troubleshooting steps to fix the "We've run into a problem with your Microsoft 365 subscription, and we need your help to fix...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just stumbled across this and ran into the same issue. My solution was to extend ClassSerializerInterceptor and basically have it apply to everything except GQL subscriptions. This way I won’t have to manually add decorators all around my code base minus subscription resolvers and instead I can register it as a global interceptor.
my-class-serializer.interceptor.ts
And register it like so
main.ts
It works when excluding all subscriptions from the serializer, but what if I want the response to be serialized? I have fields which need to be transformed, but I can’t do that as the serializer tries to transform the AsyncIterable. When doing the serialization in
resolve
it does work, but how do I serialize additional resolved values which are not included in the data which is transported over the PubSub?