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 RequestError ¶
type RequestError struct { Message string `json:"message"` Locations []operationreport.Location `json:"locations,omitempty"` Path ErrorPath `json:"path"` }
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 (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.