mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 17:06:37 +08:00
21 lines
454 B
JavaScript
21 lines
454 B
JavaScript
const Comment = {
|
|
user({author_id}, _, {loaders}) {
|
|
return loaders.Users.getByID.load(author_id);
|
|
},
|
|
replies({id}, _, {loaders}) {
|
|
return loaders.Comments.getByParentID.load(id);
|
|
},
|
|
actions({id}, _, {loaders}) {
|
|
return loaders.Actions.getByID.load(id);
|
|
},
|
|
status({status}) {
|
|
|
|
// Because the status can be `null`, we do this check.
|
|
if (status) {
|
|
return status.toUpperCase();
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = Comment;
|