Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-16 16:54:48 +01:00
parent 5864719a3f
commit 842bbfbe97
5 changed files with 13 additions and 22 deletions

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"io"
"net/http"
"strings"
"time"
"go.probo.inc/probo/pkg/version"
@@ -72,11 +73,12 @@ func (c *Client) Do(
}
if len(resp.Errors) > 0 {
msg := resp.Errors[0].Message
var msg strings.Builder
msg.WriteString(resp.Errors[0].Message)
for _, e := range resp.Errors[1:] {
msg += "; " + e.Message
msg.WriteString("; " + e.Message)
}
return nil, fmt.Errorf("GraphQL error: %s", msg)
return nil, fmt.Errorf("GraphQL error: %s", msg.String())
}
return resp.Data, nil