apollographql / graphql-subscriptions

:newspaper: A small module that implements GraphQL subscriptions for Node.js
MIT License
1.58k stars 133 forks source link

fix: Support readonly arrays as event names #234

Closed robhogan closed 2 years ago

robhogan commented 3 years ago

BREAKING Allow a readonly topics / events array to be passed to PubSubEngine.asyncIterator(). I think this is how any well-behaved implementation should treat the incoming array anyway, and it would allow read-only arrays to be accepted upstream (eg https://github.com/MichalLytek/type-graphql/pull/718)

I believe this is (minor) breaking because it could mean downstream subclasses of PubSubEngine re-implement asyncIterator with incompatible types. It might be best paired with https://github.com/apollographql/graphql-subscriptions/pull/232 ?

apollo-cla commented 3 years ago

@rh389: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/