Graphql-engine: Remote schema error when used for local dev - document that remote schema URLs should use docker host based URLs esp for local dev

Created on 25 Feb 2019  路  10Comments  路  Source: hasura/graphql-engine

Hi guys, I wanted to try the remote schema feature but it seems that it doesnt work for local development. First I thought it was an issue with my graphql server written in golang but then I tried with your nodejs boilerplate. When I add a remote schema in the UI I get this error back :

HttpExceptionRequest Request { host = "localhost" port = 4000 secure = False requestHeaders = [("Content-Type","application/json"),("User-Agent","hasura-graphql-engine/v1.0.0-alpha38")] path = "/graphql" queryString = "" method = "POST" proxy = Nothing rawBody = False redirectCount = 10 responseTimeout = ResponseTimeoutDefault requestVersion = HTTP/1.1 } (ConnectionFailure Network.Socket.connect: <socket: 13>: does not exist (Connection refused))

even though I can do an introspection query ... I tried with path "/graphql?" too and with 0.0.0.0 instead of localhost but without success. I guess that hasura remote schema only accepts https. Would it possible to add support for http too for (development purpose)? Is there a workaround that doesn't involve deploy my app? Thank's for the great work guys

docs quickfix medium

Most helpful comment

@Sach97 This seems like the docker container not being able to connect to the server running on localhost. Can you try using host.docker.internal if you're on a mac or the docker host IP basically?

That should work!

All 10 comments

@Sach97 This seems like the docker container not being able to connect to the server running on localhost. Can you try using host.docker.internal if you're on a mac or the docker host IP basically?

That should work!

Thank's it worked with my docker host IP! Maybe add some tips to the doc to help future users with local dev ?

@rikinsk Any quickfix ideas for the docs?
In this section, https://docs.hasura.io/1.0/graphql/manual/remote-schemas/index.html#step-2-merge-remote-schema we can add a few pointers on how to connect to a service running on the same host with docker host IP esp for local dev?

Yes. That seems about right

I am getting following error in Linux system
msg="apply failed: [remote-schema-error] HTTP exception occurred while sending the request to http://172.17.0.1:8000/graphql

@kalpudada Is your remote schema at http://172.17.0.1:8000/graphql running?

@kalpudada Is your remote schema at http://172.17.0.1:8000/graphql running?

Yes

@kalpudada Can you pls ping me on Discord @Tiru ?

Closing this issue as the OP's request has been done. We have a note explaining what endpoint to use with Docker here: https://docs.hasura.io/1.0/graphql/manual/remote-schemas/index.html#step-2-merge-remote-schema

@kalpudada If you are unable to contact me on Discord, pls open another issue :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lishine picture lishine  路  3Comments

leoalves picture leoalves  路  3Comments

tirumaraiselvan picture tirumaraiselvan  路  3Comments

anisjonischkeit picture anisjonischkeit  路  3Comments

jjangga0214 picture jjangga0214  路  3Comments