mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 17:54:04 +08:00
24 lines
549 B
JavaScript
24 lines
549 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.getByItemID.load(id);
|
|
},
|
|
status({status}) {
|
|
|
|
// Because the status can be `null`, we do this check.
|
|
if (status) {
|
|
return status.toUpperCase();
|
|
}
|
|
},
|
|
asset({asset_id}, _, {loaders}) {
|
|
return loaders.Assets.getByID.load(asset_id);
|
|
}
|
|
};
|
|
|
|
module.exports = Comment;
|