setting up dashboard :)

This commit is contained in:
Riley Davis
2017-02-10 15:32:30 -07:00
parent 5c4daa72cb
commit d4e68de349
9 changed files with 112 additions and 14 deletions
+9 -1
View File
@@ -34,7 +34,7 @@ const RootQuery = {
// Map the actions from the items referenced byt this query. The actions
// returned by this query are explicitly going to be distinct by their
// `item_id`'s.
let ids = actions.map((action) => action.item_id);
let ids = actions.map(({item_id}) => item_id);
// Perform the query using the available resolver.
return Comments.getByQuery({ids, statuses, asset_id, parent_id, limit, cursor, sort});
@@ -44,6 +44,14 @@ const RootQuery = {
return Comments.getByQuery(query);
},
metric(_, args, {user, loaders: {Assets}}) {
if (user == null || !user.hasRoles('ADMIN')) {
return null;
}
return Assets.getForMetrics();
},
// This returns the current user, ensure that if we aren't logged in, we
// return null.
me(_, args, {user}) {