postman-app-support
postman-app-support copied to clipboard
WSL2 `ECONNREFUSED` on GraphQL Request
Is there an existing issue for this?
- [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed
Describe the Issue
While schema fetch and queries work fine with standard HTTP request and Body=GraphQL, the same doesn't work with the new GraphQL Request request type. The localhost domain should resolve to the WSL ip but it doesn't. Strangely, sometimes it works but can't reproduce it on a steady base.
Working:
Not working:
Steps To Reproduce
- Open a new GraphQL Request
- Add a GraphQL URL backed by a service running on WSL2
- Try to get schema from introspection
Screenshots or Videos
No response
Operating System
Windows 10
Postman Version
10.12.4
Postman Platform
Postman App
User Account Type
Signed In User
Additional Context?
No response
@kliakos Thanks for reporting this issue.
Strangely, sometimes it works but can't reproduce it on a steady base.
🤔 That's weird since both use the same request-sending library.
@kliakos Thanks for reporting this issue.
Strangely, sometimes it works but can't reproduce it on a steady base.
🤔 That's weird since both use the same request-sending library.
The case that I have seen it to work is when I first do the schema fetch from the standard HTTP request tab, and then I try the same (get schema from instrospection) from the GraphQL Request tab. Seems like some kind of dns caching happens which is persisted for some time, but it doesn't last long. But this "trick" doesn't work all the time.
The temp workaround is to use the WSL ip directly instead of localhost, but of course I would expect this issue to be addressed at some time soon.
This seems to also affect Websocket Request. The WSL IP address workaround seems to work as well.
related to #11204
related to #11204
to save others time here is the simplest solution that fixes this in the other issue:
replace local host with wsl IP retrieved from wsl hostname -I
credit: https://github.com/postmanlabs/postman-app-support/issues/11204#issuecomment-1751987249
Guys, this has worked for me:
- Type
ifconfigin your WSL terminal - Grab the
eth0IP and replace it in your postman url, ex:http://192.168.212.235:3000/graphql
No more errors, the schema will be fetched as expected.