Library improvements.

This commit is contained in:
2025-05-23 12:59:04 +01:00
parent 067841471f
commit 8c2c6068c5
14 changed files with 1252 additions and 7 deletions
+3 -1
View File
@@ -3,6 +3,7 @@ package gql
import (
"bytes"
"compress/gzip"
"crypto/tls"
"errors"
"fmt"
"io"
@@ -22,6 +23,7 @@ var (
IdleConnTimeout: 90 * time.Second,
DisableCompression: false, // Enable compression for responses
ForceAttemptHTTP2: true,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // Skip TLS verification for test environments
}
// Shared HTTP client with timeouts
@@ -45,7 +47,7 @@ func (qe *QueryExecutor) executeQuery() ([]byte, error) {
Message: "Can't create HTTP request",
Pairs: map[string]interface{}{"error": err.Error()},
})
return nil, err
return nil, fmt.Errorf("can't create HTTP request: %w", err)
}
for key, value := range qe.Headers {