Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Client *http.Client BaseURL string RequestInterceptor RequestInterceptor }
Client is the http client wrapper
type ErrorResponse ¶
type ErrorResponse struct { // populated when http status code is not OK NetworkError *HTTPError `json:"networkErrors"` // populated when http status code is OK but the server returned at least one graphql error GqlErrors *gqlerror.List `json:"graphqlErrors"` }
ErrorResponse represent an handled error
func (*ErrorResponse) Error ¶
func (er *ErrorResponse) Error() string
func (*ErrorResponse) HasErrors ¶
func (er *ErrorResponse) HasErrors() bool
HasErrors returns true when at least one error is declared
type GQLRequestInfo ¶
type GQLRequestInfo struct {
Request *Request
}
func NewGQLRequestInfo ¶
func NewGQLRequestInfo(r *Request) *GQLRequestInfo
type GqlErrorList ¶
GqlErrorList is the struct of a standard graphql error response
func (*GqlErrorList) Error ¶
func (e *GqlErrorList) Error() string
type Request ¶
type Request struct { Query string `json:"query"` Variables map[string]interface{} `json:"variables,omitempty"` OperationName string `json:"operationName,omitempty"` }
Request represents an outgoing GraphQL request
type RequestInterceptor ¶
type RequestInterceptor func(ctx context.Context, req *http.Request, gqlInfo *GQLRequestInfo, res interface{}, next RequestInterceptorFunc) error
func ChainInterceptor ¶
func ChainInterceptor(interceptors ...RequestInterceptor) RequestInterceptor
type RequestInterceptorFunc ¶
Click to show internal directories.
Click to hide internal directories.