You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internal error occurred during message handling. Please check your implementation. Error: Subscription field must return Async Iterable. Received: undefined.
#405
Open
alexpchin opened this issue
May 11, 2022
· 1 comment
Internal error occurred during message handling. Please check your implementation. Error: Subscription field must return Async Iterable. Received: undefined.
Very funny, that I started to resolve the same on my own, 3 days ago!
My requirement was to leverage an existing resolver to resolve subscription.
As per the document I tried resolve: (_id) => Task.findById(_id)
Task is my mongoose model object, however, it's different of the existing mongooseResolvers.findById which I've wrapResolve to extend the working. So using directly the model instead of the compose query.
The second line is important to retrieve projection based of what has been sent during the Subscription {} phase.
The third line is used to exec the resolver using parameters.
I will try to propose a PR to improve documentation about this.
Let me know if it solves your problem?
When creating a subscription resolver as follows:
and adding it to:
I see the error:
However, when adding as so:
This is fine.
For resolvers, I am adding as per:
Any ideas why this wouldn't be ok?
The text was updated successfully, but these errors were encountered: