Can`t connect to uri https://89.116.232.181:4000/graphql , that working in apollo sandbox

I am using apollo graphql client in react native android app.
my code:
const httpLink = createHttpLink({
uri: “https://89.116.232.181:4000/graphql”, - not real address but the same format
})
const httpLinkWithOptions = ApolloLink.from([
cleanTypeName,
authFlowLink,
httpLink,
])
export const client = new ApolloClient({
link: httpLinkWithOptions,
cache
})
Error : Network request failed

You typically cannot connect via https to an IP address, because certificate verification for the encryption (the s) relies on the domain name. I’m actually not sure why that works from sandbox—is it an embedded sandbox from the server or the Apollo-hosted sandbox?

1 Like