@Component
public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class)
public GraphQLError handleNormalException(Exception e, ErrorContext ctx) {
return GraphqlErrorBuilder.newError()
.path(ctx.getPath())
.errorType(ctx.getErrorType())
.message(e.getMessage())
.build();
}
}
自己记录的一些笔记,内容如有不对请指正


