graphql-bookstore
graphql-bookstore copied to clipboard
Subscriptions throw an exception on the server
Book creation results in an exception on the server:
Cannot read property 'bookService' of undefined
The underlying reason is that dataSources are not passed to resolvers during pubsub.publish()
Related issues:
- https://github.com/apollographql/apollo-server/issues/1526
- https://github.com/apollographql/apollo-server/issues/1553
For now, I have worked around this issue by creating a global instance of dataSources instead of passing it via context.
When was the last time you checked if this was still an issue?
@nareshbhatia up
Don't think there is an update from Apollo on this issue. See the comments on their roadmap, e.g. https://github.com/apollographql/apollo-server/issues/2360#issuecomment-641697135