Readd lastComment field to asset resolver

This commit is contained in:
Chi Vinh Le
2017-05-17 01:25:06 +07:00
parent e561819c8d
commit 7d858c7b3f
+7
View File
@@ -1,4 +1,11 @@
const Asset = {
lastComment({id}, _, {loaders: {Comments}}) {
return Comments.getByQuery({
asset_id: id,
limit: 1,
parent_id: null
}).then((data) => data[0]);
},
recentComments({id}, _, {loaders: {Comments}}) {
return Comments.genRecentComments.load(id);
},