Currently , our response structure is
{
success: boolean,
message: string,
data: any,
error: any
}
// and status code (HTTP status code)
The resolver can only define the status code and data property of the response(generally saying response, not to be conflict with the library's response object). The success, message and error are controlled by the library. In real world, we may want to response custom error message( for explaining customer about the business logic related error details). We may want to set our custom error object ( perhaps, with custom error code(not HTTP) with internal rules). In this case, how should we attach that? Just in data property of the response ?
Currently , our response structure is
The resolver can only define the status code and data property of the response(generally saying response, not to be conflict with the library's response object). The success, message and error are controlled by the library. In real world, we may want to response custom error message( for explaining customer about the business logic related error details). We may want to set our custom error object ( perhaps, with custom error code(not HTTP) with internal rules). In this case, how should we attach that? Just in data property of the response ?