Using async await

This commit is contained in:
Belen Curcio
2017-07-24 16:40:08 -03:00
parent 36df7cb784
commit a036a051cb
+5 -3
View File
@@ -4,11 +4,13 @@ const Asset = {
recentComments({id}, _, {loaders: {Comments}}) {
return Comments.genRecentComments.load(id);
},
comment({id}, {id: commentId}, {loaders: {Comments}}) {
return Comments.getByQuery({
async comment({id}, {id: commentId}, {loaders: {Comments}}) {
const comments = await Comments.getByQuery({
asset_id: id,
ids: commentId
}).then((c) => c.nodes[0]);
});
return comments.nodes[0];
},
comments({id}, {sort, limit, deep, excludeIgnored, tags}, {loaders: {Comments}}) {
return Comments.getByQuery({