graphql / graphql-playground

🎮 GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
MIT License
8.77k stars 735 forks source link

GraphQL Playground takes multiple tries to establish a websocket connection for subscription #1253

Open Sankalan13 opened 4 years ago

Sankalan13 commented 4 years ago

This issue pertains to the following package(s):

What OS and OS version are you experiencing the issue(s) on?

Linux 20.04

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.7.20

What is the expected behavior?

Subscription should work on the first try.

What is the actual behavior?

Need to initiate subscription again and again and it works after 2-3 tries. Giving the following error: { "error": "Could not connect to websocket endpoint wss://mundane-camp-4074.us-east-1.aws.thegaas.com/graphql. Please check if the endpoint url is correct." }

What steps may we take to reproduce the behavior?

  1. Have a subscription-able schema added to your graphql server
  2. Open the GraphQL Explorer and run a subscription
  3. You will not be able to connect on the first try

Please provide a gif or image of the issue for a quicker response/fix. image