Attempt to fix the graphQL endpoint setup.

This commit is contained in:
2021-05-29 20:22:28 +01:00
parent 2b49e557e4
commit f6ee82113a
4 changed files with 10 additions and 4 deletions
+5 -2
View File
@@ -11,6 +11,7 @@ import (
"fmt"
"os"
"github.com/lukaszraczylo/zero"
"github.com/tidwall/gjson"
"github.com/valyala/fasthttp"
)
@@ -27,10 +28,12 @@ type requestBase struct {
func prepare() {
value, present := os.LookupEnv("GRAPHQL_ENDPOINT")
if GraphQLUrl == "" && present {
if present {
GraphQLUrl = value
} else if GraphQLUrl == "" && !present {
} else if zero.IsZero(GraphQLUrl) && !present {
GraphQLUrl = "http://127.0.0.1:9090/v1/graphql"
} else {
fmt.Println("GraphQL endpoint not set.")
}
}