Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorPath ¶
type ErrorPath struct {
// contains filtered or unexported fields
}
func (*ErrorPath) MarshalJSON ¶
type Extensions ¶
type Extensions struct {
Code string `json:"code"`
}
type RequestError ¶
type RequestError struct { Message string `json:"message"` Locations []operationreport.Location `json:"locations,omitempty"` Path ErrorPath `json:"path"` // Extensions is typically used for Apollo compatibility Extensions *Extensions `json:"extensions,omitempty"` }
func (RequestError) Error ¶
func (o RequestError) Error() string
func (RequestError) MarshalJSON ¶
func (o RequestError) MarshalJSON() ([]byte, error)
type RequestErrors ¶
type RequestErrors []RequestError
func RequestErrorsFromError ¶
func RequestErrorsFromError(err error) RequestErrors
func RequestErrorsFromOperationReport ¶
func RequestErrorsFromOperationReport(report operationreport.Report) (errors RequestErrors)
func RequestErrorsFromOperationReportWithStatusCode ¶
func RequestErrorsFromOperationReportWithStatusCode(report operationreport.Report) (statusCode int, errors RequestErrors)
func (RequestErrors) Count ¶
func (o RequestErrors) Count() int
func (RequestErrors) Error ¶
func (o RequestErrors) Error() string
func (RequestErrors) ErrorByIndex ¶
func (o RequestErrors) ErrorByIndex(i int) error
func (RequestErrors) WriteResponse ¶
func (o RequestErrors) WriteResponse(writer io.Writer) (n int, err error)
WriteResponse writes the given request errors to the http.ResponseWriter. It should only be used to write errors that are happening before the execution of the query e.g. validation errors.
type Response ¶
type Response struct { Errors Errors `json:"errors,omitempty"` // data: null will never be included in the response because this struct should be used for errors that happening before execution // This behaviour is compliant with the spec https://spec.graphql.org/draft/#sec-Data Data any `json:"data,omitempty"` }
Response is the GraphQL response object It should only be used to write errors that are happening before the execution of the query e.g. validation errors.
Click to show internal directories.
Click to hide internal directories.