Meteor/React/Apollo/Graphql Subscriptions (using GooglePubSub)

Yes that’s the post I referred to to figure out that the imports may be messy. App is my main component and all my other React components are children of it, and many of them use the withApollo HOC.

In your app you don’t use the withApollo HOC? That error is still thrown because my child components use the withApollo HOC.

It’s deprecated. But it’s very easy to pass client in as a prop to a component.

Oh wow I had no idea they were deprecated, I followed a tutorial for the setup and it looks like it’s very outdated now, thank you for the clarification.

One last question - in the network tab I see a perpetual websocket connection open. Does that many ALL queries/mutations/subscriptions are through this websocket connection? That means every user that visits every page will have this websocket connection open?

Because previously when running queries it was just a single call to the server, but now queries will go through this websocket connection.

That’s a great question. I’d like to know more about this myself. Please ping me if you find out more.

1 Like

P.S. – I believe Meteor uses that same websocket.

1 Like

Right, I have not tested that yet, will check that out soon. Thank you again for the help. I have posted this question in the package’s issues section, hopefully more light can be shed there, because I’m not sure if this solution is ideal to have a websocket connection open all the time.

1 Like