-
Notifications
You must be signed in to change notification settings - Fork 2
Description
See here
| pubsub.publish("NUMBER_INCREMENTED", { numberIncremented: currentNumber }); |
This should be pubsub.publish("NUMBER_INCREMENTED", currentNumber) instead. The wrapper object contains the subscription name.
Also it would be good to have some sort of lightweight pubsub for testing. https://github.com/apollographql/graphql-subscriptions is too much for me and actually unusable because there's no built-in browser api, it uses node's events package which I don't have in the browser tests. I do happen to have rxjs, so I'm using that, I did have to pull in some async iterator converter though. And I also don't need the event name, I just want to publish the same type of event for this particular subscription.
Maybe rethink the api for subscription? Not even sure what the "resolve" method is for and having the underlying "subscribe" is unintuitive. Maybe just accept what subscribe accepts or just the pubsub api you come up with