@DgsComponent
public class HelloDataFetcher {
@DgsData(parentType = "Query", field = "hello")
@DgsEnableDataFetcherInstrumentation(false)
public String hello(DataFetchingEnvironment dfe) {
throw new MyException();
}
}
"""
Error format as defined in GraphQL Spec
"""
interface GraphQLError {
message: String! // Required by GraphQL Spec
locations: [Location] // See GraphQL Spec
path: [String | Int] // See GraphQL Spec
extensions: TypedError
}
interface TypedError {
"""
An error code from the ErrorType enumeration.
An errorType is a fairly coarse characterization
of an error that should be sufficient for client
side branching logic.
"""
errorType: ErrorType!
"""
The ErrorDetail is an optional field which will
provide more fine grained information on the error
condition. This allows the ErrorType enumeration to
be small and mostly static so that application branching
logic can depend on it. The ErrorDetail provides a
more specific cause for the error. This enumeration
will be much larger and likely change/grow over time.
"""
errorDetail: ErrorDetail
"""
Indicates the source that issued the error. For example, could
be a backend service name, a domain graph service name, or a
gateway. In the case of client code throwing the error, this
may be a client library name, or the client app name.
"""
origin: String
"""
Optionally provided based on request flag
Could include e.g. stacktrace or info from
upstream service
"""
debugInfo: DebugInfo
"""
Http URI to a page detailing additional
information that could be used to debug
the error. This information may be general
to the class of error or specific to this
particular instance of the error.
"""
debugUri: String
}