axelspringer / graphql-google-pubsub

A graphql-subscriptions PubSub Engine using Google PubSub
MIT License
136 stars 43 forks source link

set GooglePubSub.pubSubClient to public #13

Closed hcharley closed 5 years ago

hcharley commented 5 years ago

Hi, I'd like to use the pubSubClient connection outside of the GooglePubSub class. Would it be alright to set it public to use it?

I'd prefer to just piggyback off of the connection created with this library, than have to create my own PubSub object.

jonas-app commented 5 years ago

Hey @charlex, thx for your contribution! 👏 I think you are far more flexible if you pass your own PubSub instance. It's nothing more than new PubSub(config). Do you have an argument against it? I may consider making it public, as it wouldn't really harm.

hcharley commented 5 years ago

I was hoping that with this simple change, I could avoid having to have my own dependency of @google-cloud/pubsub.

I don't really have a problem installing @google-cloud/pubsub myself into my package.json, but I figured that since you're already creating this for me, it would just be easiest to expose it as public.

jonas-app commented 5 years ago

@charlex Thx again for your contribution. 🏆 It's merged and published with version 1.2.0. Let me know if all works out for you.