graphqlclient

package
v1.40.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTokenRefresh = errors.New("token validity check failed")

ErrTokenRefresh marks refresh failures, which must not be retried: a rotated refresh token can't be reused.

Functions

func IsAuthError added in v1.40.0

func IsAuthError(err error) bool

IsAuthError reports whether the CRE API rejected the credentials themselves.

func IsRetryable added in v1.40.0

func IsRetryable(err error) bool

IsRetryable reports whether a failed request is worth repeating. Context errors are excluded so callers' cancellations and deadlines are honoured.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(creds *credentials.Credentials, environmentSet *environments.EnvironmentSet, l *zerolog.Logger) *Client

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, req *graphql.Request, resp any) error

func (*Client) RefreshTokenIfNeeded added in v1.40.0

func (c *Client) RefreshTokenIfNeeded(ctx context.Context) error

type HTTPStatusError added in v1.40.0

type HTTPStatusError struct {
	StatusCode int
	Message    string
	RetryAfter time.Duration
}

HTTPStatusError is returned when the CRE API responds with an unhandled non-2xx status. Message holds only the GraphQL error message; raw bodies stay out so they never reach telemetry.

func (*HTTPStatusError) Error added in v1.40.0

func (e *HTTPStatusError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL