-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pubsub.asyncIterator typescript type #4556
Comments
I know I can use |
i solve it with subscribe: async ( |
Hi guys I came across this issue and this worked for me: Subscription: {
userUpdated: {
subscribe: () => ({
[Symbol.asyncIterator]: () => pubSub.asyncIterator(['USER_UPDATED']),
}),
},
}, Basically the best way to handle this is to make your Issue came up as part of strongly typing my Apollo Server Resolvers using Codegen |
Looks like this is more relevant to the (not super actively maintained, unfortunately) Actually I think this might be fixed by apollographql/graphql-subscriptions#232 which @hwillson has scheduled to be released in 3.0 apollographql/graphql-subscriptions#250 |
typecast subscription resolvers to address AsyncIterator codegen mismatch, as described here apollographql/apollo-server#4556 and to be imminently resolved per graphql-subscriptions v3.0
package: graphql-subscriptions
version: 1.1.0
expected behavior: code like down is typescript ok
actual behavior: typescript errors
Type 'AsyncIterator<number, any, undefined>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.
The text was updated successfully, but these errors were encountered: