graphql-subscriptions
graphql-subscriptions copied to clipboard
Better error should be thrown if subscription ID is invalid
When passing in an invalid ID such as 0
to Pubsub.unsubscribe()
it will throw with an unhelpful error.
TypeError: Cannot read property '0' of undefined
at PubSub.unsubscribe (/usr/local/bin/api/node_modules/graphql-subscriptions/dist/pubsub.js:40:61)
at /usr/local/bin/api/dist/index.js:34948:22
at Timeout._onTimeout (/usr/local/bin/api/dist/index.js:19003:29)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
https://github.com/apollographql/graphql-subscriptions/blob/d8bfcae8488747a868b171e47542e17a0bd9f42f/src/pubsub.ts#L33-L37