Skip to content
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

Subscriptions throw an exception on the server #2

Open
nareshbhatia opened this issue Dec 9, 2018 · 3 comments
Open

Subscriptions throw an exception on the server #2

nareshbhatia opened this issue Dec 9, 2018 · 3 comments

Comments

@nareshbhatia
Copy link
Owner

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. Datasources missing in the context when using subscriptions apollographql/apollo-server#1526
  2. Unable to get context for subscriptions apollographql/apollo-server#1553

For now, I have worked around this issue by creating a global instance of dataSources instead of passing it via context.

@robross0606
Copy link

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

@snwfdhmp
Copy link

@nareshbhatia up

@nareshbhatia
Copy link
Owner Author

Don't think there is an update from Apollo on this issue. See the comments on their roadmap, e.g. apollographql/apollo-server#2360 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants