我想将我的Expo(React Native)应用程序链接到本地GraphQL后端,
http://localhost:4000/
<-工作良好
http://192.168.X.X:4000/
<-这不起作用
我确实看到了阿波罗工作室的页面,但它出现了以下消息:
Unable to reach server
Network requests from Studio on HTTPS to your HTTP endpoint are not secure,
so we cannot introspect your endpoint.
https://studio.apollographql.com/sandbox/explorer
Apollo Studio有一个特殊的例外,允许它与' localhost ';通过http,但所有其他端点必须通过https。
如果你(像我一样)在本地机器上运行虚拟机,并且需要使用Apollo Studio,唯一的解决方案是以某种方式使连接https,或者在主机操作系统中转发一个端口,以便你可以通过localhost访问它。这取决于你的操作系统。