graphql-bookstore icon indicating copy to clipboard operation
graphql-bookstore copied to clipboard

Subscriptions throw an exception on the server

Open nareshbhatia opened this issue 7 years ago • 3 comments

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:

  1. https://github.com/apollographql/apollo-server/issues/1526
  2. 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.

nareshbhatia avatar Dec 09 '18 00:12 nareshbhatia

When was the last time you checked if this was still an issue?

robross0606 avatar Aug 12 '19 19:08 robross0606

@nareshbhatia up

snwfdhmp avatar Jun 10 '20 12:06 snwfdhmp

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

nareshbhatia avatar Jul 04 '20 19:07 nareshbhatia