func NewClient(provider common.StashServerConnection) *graphql.Client {
	portStr := strconv.Itoa(provider.Port)

	u, _ := url.Parse("http://" + provider.Host + ":" + portStr + "/graphql")
	u.Scheme = provider.Scheme

	cookieJar, _ := cookiejar.New(nil)

	cookie := provider.SessionCookie
	if cookie != nil {
		cookieJar.SetCookies(u, []*http.Cookie{
			cookie,
		})
	}

	httpClient := &http.Client{
		Jar: cookieJar,
	}

	return graphql.NewClient(u.String(), httpClient)
}
// NewClient creates a graphql Client connecting to the stash server using
// the provided server connection details.
// Always connects to the graphql endpoint of the localhost.
NewClient creates a graphql Client connecting to the stash server using
the provided server connection details.
Always connects to the graphql endpoint of the localhost.
// NewClient creates a graphql Client connecting to the stash server using // the provided server connection details . // Always connects to the graphql endpoint of the localhost .
func NewClient(provider common.StashServerConnection) *graphql.Client {
	portStr := strconv.Itoa(provider.Port)
	u, _ := url.Parse("http://" + provider.Host + ":" + portStr + "/graphql")
	u.Scheme = provider.Scheme
	cookieJar, _ := cookiejar.New(nil)
	cookie := provider.SessionCookie
	if cookie != nil {
		cookieJar.SetCookies(u, []*http.Cookie{
			cookie,
		})
	}
	httpClient := &http.Client{
		Jar: cookieJar,
	}
	return graphql.NewClient(u.String(), httpClient)
}
func NewClient ( provider common . StashServerConnection ) * graphql . Client { portStr := strconv . Itoa ( provider . Port ) u , _ := url . Parse ( " " + provider . Host + " " + portStr + " " ) u . Scheme = provider . Scheme cookieJar , _ := cookiejar . New ( nil ) cookie := provider . SessionCookie if cookie != nil { cookieJar . SetCookies ( u , [ ] * http . Cookie { cookie , } ) } httpClient := & http . Client { Jar : cookieJar , } return graphql . NewClient ( u . String ( ) , httpClient ) }
NewClient creates a graphql Client connecting to the stash server using
the provided server connection details.
NewClient creates a graphql Client connecting to the stash server using the provided server connection details .