Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GraphQLErrorCodeToStatus ¶
func GraphQLErrorCodeToStatus(code GraphQLErrorCode) int
func NewGraphQLError ¶
func NewGraphQLError(msg string, code GraphQLErrorCode) error
NewGraphQLError creates a new GraphQLError. The message must be safe for external consumption.
Types ¶
type GraphQLError ¶
type GraphQLError struct { Msg string Code GraphQLErrorCode }
func (*GraphQLError) Error ¶
func (graphQLError *GraphQLError) Error() string
Error implements the error interface.
type GraphQLErrorCode ¶
type GraphQLErrorCode = string
Define GraphQL error codes.
const ( GQLParsedFailed GraphQLErrorCode = "GRAPHQL_PARSE_FAILED" GQLValidationFailed GraphQLErrorCode = "GRAPHQL_VALIDATION_FAILED" GQLBadUserInput GraphQLErrorCode = "BAD_USER_INPUT" GQLUnauthenticated GraphQLErrorCode = "UNAUTHENTICATED" GQLForbidden GraphQLErrorCode = "FORBIDDEN" GQLPersistedQueryNotFound GraphQLErrorCode = "PERSISTED_QUERY_NOT_FOUND" GQLPersistedQueryNotSupported GraphQLErrorCode = "PERSISTED_QUERY_NOT_SUPPORTED" GQLInternalServerError GraphQLErrorCode = "INTERNAL_SERVER_ERROR" )
Click to show internal directories.
Click to hide internal directories.