-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to local GraphQL Server running at localhost:PORT #2603
Comments
Have you tried setting Uri to your local Network ip? E.g 192.168.... |
Yes! I already did -- still not working. |
@akashbdj can you open the network panel and see where the request is trying to go to? |
Okay. This is completely weird. 😖 When both of my devices(laptop and mobile) are connected to our home wifi, I couldn't even remote debug my application. It keeps on saying, "It is taking too much time than it should". 😣 After a couple of tries, I turned off my wifi and started using phone network(4G) and connected my laptop to it through hotspot. Now, I can remote debug! Network request were also getting resolved. I was able to see the proper response. 🙄 May I know why is it happening with my WiFi? Anybody else facing the same issue? |
I ended up using ngrok for development! |
@akashbdj I too was having this same issue on my home wifi, using ngrok solved it for me! Does anyone have the answer to this though? Seems weird... |
Same for me. |
Same here. Using the latest apollo client 2.1 The only result I get is the Network Error: import ApolloClient from "apollo-boost"; |
Try adding cors on the graphql server:
|
How does this not work? All my other queries work fine... Not sure why this one doesn't want to... |
I am also getting the same issue. |
Ss someone able to share the code after usage of Ngrok? I am not sure what I exactly have to do to make my client App (Apollo) working with the server that is running on the other laptop (Linux). |
Issue already closed, but just encountered the same issue using Prisma (uses Apollo Server on the inside). What resolved it on my side was to use the host machine's IP address : port on the server (Prisma) in the cors settings and also use the host machine IP : port (front) on the client. |
you don't need the '/graphql' in the uri; it has to be "http://localhost:4000" |
what worked for me is doing michaelknoch's suggestion, if you are on port 4000, e.g.: http://192.168.56.1:4000/ |
For me neither local IP address nor ngrok worked. So instead of generating an ngrok for the frontend, I generated it for the backend so that it becomes https. Then connected to frontend through local IP. Now everything works well. Hope this helps someone, or me in the near future! |
In my case, I was using the Brave browser. "Brave does not support network requests from Studio on HTTPS to your local HTTP endpoint, so we cannot introspect your endpoint. There are a few solutions: |
Thanks) |
I'm trying to connect to GraphQL server running at http://MY_MACHINE_IP:PORT using apollo-client and react-apollo.
I'm using expo to create React Native application and trying to run it on my real device(iOS)
It's working on iOS Simulator, though!
Intended outcome:
It should return proper response I was expecting.
Actual outcome:
Network Error: Network Request Failed.
Version
Screenshots:
What I'm trying to do:
Error Screenshot:
Please let me know if you need any more information.
Thanks
The text was updated successfully, but these errors were encountered: