Graphql WSS Subscriptions issue

Hello

I’m having a problem getting my static react website to talk to a postgraphile graphql service I have set up running with node express.

The graphql querying over the https link I have set up as an environment variable seems to be working fine. However the subscription service, which has been working fine locally, fails to connect when I changed it from ws to wss as an environment variable, i.e:-

REACT_APP_GRAPHQL_HTTP=‘https://game-tokens-graphql.onrender.com/graphql

works fine. However:-

REACT_APP_GRAPHQL_WS=‘wss://game-tokens-graphql.onrender.com/graphql’

fails.

I came across this discussion:-

which I thought may be quite useful in suggestions the base URL was required, i.e. wss://game-tokens-graphql.onrender.com, but that hasn’t worked either.

Has anyone been able to get graphql subscriptions working here?

I’m wondering if it is something simple like leaving the REACT_APP_GRAPHQL_WS variable pointing at the base onrender URL and adding a redirect to “/graphql” in my express service? Or maybe it’s an issue with my port in express - I was using 5000 testing locally but does it need to be set to 443!

Thanks for reading. Would appreciate any help if anyone else has had a similar problem.

Hi Alan,

Can you share with us the error you see when subscribing? What does the browser network show when making the call to wss://game-tokens-graphql.onrender.com?

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.