Closed jasonmccallister closed 4 years ago
Hi @jasonmccallister ,
This error means that the call has been done with a url missing the trailing http://
or https://
.
Are you sure you have the https://
in srv.URL
? Did you print it to be sure?
Did you try to enable the logs in the client? client.Log = func(s string) { log.Println(s) }
(with client
being your graphql client).
Note: I have no affiliation with this project, just a user.
Thanks Joseph
@aerostitch that makes sense, however, I double checked the srv.URL
contains the protocol in the test as it comes from httptest.NewTSLServer()
. I took the same approach on the tests provided in the package but could not figure it out.
Did you try with httptest.NewServer()
instead of the TLS version? I use that in my tests and it works pretty well.
I did try that first, then I switched to TLS after. Also, I did not mention this in the original response but thank you for taking the time to respond!
Thank you for this excellent package! Made writing some scripts with Go and our GraphQL API (specifically this GraphQL API which has been amazing https://github.com/hasura/graphql-engine).
We are using Hasura with Lambda event functions, which takes a
events.APIGatewayProxyRequest
. Since we are using the "serverless" functionality we decided to use Go for Lambda and started writing unit tests against our Hasura API.My question is to make sure I am on the right track, I have used some of your test code to get myself pretty far, so thank you, but I am stuck on one specific problem. Here are the steps I have taken so far:
srv.URL
tographql.NewClient(srv.URL)
Here is a sample of the test:
However, when running the tests, I am getting an error with
unsupported protocol scheme ""
that is coming from:Any help or pointers would be greatly appreciated!