-
Notifications
You must be signed in to change notification settings - Fork 107
sendIntrospectionQuery gives ECONNREFUSED with localhost server #180
Comments
From npm@5.2, you can use npx
Can you provide details of the |
Ah, okay. I get the following error, which doesn't appear to be that useful:
I do have CORS enabled on my server. Quite honestly I'm leaning towards something weird on my end, because I read the sendIntrospectionQuery code and it looks pretty straightforward. |
Can you call it from a client supporting GraphQL like Insomnia? |
Yeah, the server is running in the right place. I even did a |
@NicholasLYang you ever figure this out? I just switch and endpoint from
Any idea what is cause of this? I tried with ngrok and got same result:
If run |
Disregard my comments. Typo in url. Had |
@NicholasLYang this issue also drove me a bit crazy today. It seems that Rocket has some issues serving on localhost: https://stackoverflow.com/a/59668606 For me the following worked: Whereas the query I would typically do does not work: This was really surprising and hard to debug. I imagine many people are combining a Rust/Rocket/Juniper backend and Reason/Apollo frontend, so perhaps it is worth calling out this issue somewhere in the documentation. So that search engines can further index on the error state, the error I was initially getting was: |
For my future self and also all other help seekers: If you use the local route ip via |
This is a bit of a puzzler (and quite possibly not the fault of this library at all). I'm running my Rust/Juniper GraphQL server on localhost (port 4000) and attempting to run sendIntrospectionQuery.
A quick aside, the docs aren't really friendly to people who are using npm. Any idea what the equivalent npm command is? I'd be happy to open a PR to add it to the documentation. I'm running
node node_modules/graphql_ppx/sendIntrospectionQuery
if it matters.Anyways, the script fails with an ECONNREFUSED and my server doesn't even appear to notice the request. However, when I proxy the server using ngrok, this request goes through. Any idea why this happens?
Thanks,
Nicholas
The text was updated successfully, but these errors were encountered: