I have some server-side code that instantiates an ApolloClient
to connect to an Apollo Server that I’m running.
When I try to issue a query, I get:
Error editing product request to http://localhost:3000/apps/gql/sutrob88-e04e-4970-955d-97cf35d3e9ab failed, reason: connect ECONNREFUSED ::1:3000
However, if I drop http://localhost:3000/apps/gql/sutrob88-e04e-4970-955d-97cf35d3e9ab
into a browser, the Apollo Studio comes up without any issues. So, clearly, the server is responsive on port 3000
One thing I noticed is that it’s reporting that it can’t connect to ::1:3000
. I know that ::1
is the IPv6 version of localhost
. I also know that the Express vhost
that maps to my Apollo server probably doesn’t have that as a supported vhost.
So, if that’s the issue, my question is probably "why is my ApolloClient using IPv6 and how can I prevent it. Alternatively… what’s going on here??