loopbackio / loopbackio/loopback-next
Could not connect to websocket error when using subscription in graphql example source code
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
I'm got this error with response when calling subscription in **graphql example** source code. Please check the error description and image bellow.
```
{
"error": "Could not connect to websocket endpoint ws://localhost:3000/subscriptions. Please check if the endpoint url is correct."
}
```

STEP TO REPRODUCE.
```
Step 1: Clone the loopback-next source code.
Step 2: Run npm install in the root of source code (not in the example directory)
Step 3: npm start and check the error when calling subscription.
```
System information
```
OS: Windows 10
CPU: AMD Ryzen 5
```
Contributor guide
Research direction
Start by following the issue's reproduction steps in the graphql example and inspect how the subscription WebSocket endpoint is configured. Compare the configured endpoint with ws://localhost:3000/subscriptions and verify the subscription connects successfully; the issue is done when the example no longer reports the connection error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, nodejs, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100