func ExecuteQuery()

in pkg/graphql/client/client.go [51:65]


func ExecuteQuery(ctx context.Context, request *graphql.Request, response any) error {
	username := ctx.Value(contextkey.Username{}).(string)
	password := ctx.Value(contextkey.Password{}).(string)
	authorization := ctx.Value(contextkey.Authorization{}).(string)
	if authorization == "" && username != "" && password != "" {
		authorization = "Basic " + base64.StdEncoding.EncodeToString([]byte(username+":"+password))
	}
	if authorization != "" {
		request.Header.Set("Authorization", authorization)
	}

	client := newClient(ctx)
	err := client.Run(ctx, request, response)
	return err
}