'How to connect IOS Expo GO to localhost on another machine

So I'm starting to learn react-native and wanted to test some graphql queries within it, but I can't quite get the hang of it.

I'm hosting a localserver on a notebook running ubuntu 20.04 and I'm trying to do the requests via an Iphone through Expo GO. I should say I can query my graphql server directly via the iphone browser, it's just inside the app that it doesn't work.

I've tried a lot of things I saw on similar questions, like disabling the firewall and putting the machines local ip at the graphql client, but none worked.

I've set up my apollo-client with the IP like this:

apollo-client setup

The query I'm trying to run just returns a string and this is how I'm calling it:

query set up

query call

I can see the query is working through the web view for the app on the same pc the server's running, but just cant get it to render at the Expo GO thing.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source