The error I’m getting when I hover over subscribe is:
Type '(_parent: {}, _args: {}, context: Context) => AsyncIterator<unknown, any, undefined>' is not assignable to type 'SubscriptionSubscribeFn<any, {}, any, {}>'.
Type 'AsyncIterator<unknown, any, undefined>' is not assignable to type 'AsyncIterable<any> | Promise<AsyncIterable<any>>'.
Type 'AsyncIterator<unknown, any, undefined>' is missing the following properties from type 'Promise<AsyncIterable<any>>': then, catch, finally, [Symbol.toStringTag]ts(2322)
I’m not sure what I’m missing to get this working. What am I missing?
This will however depend on the packages versions you are using. I’m personally using the latest versions of apollo-server, graphql-subscriptions, and ‘graphql-redis-subscriptions’
I was able to get subscriptions to work by simply ignoring the error. I know that’s not the ideal solution but it was the only way I could find to get this to work.