added user query by value to graph

This commit is contained in:
Wyatt Johnson
2018-01-03 14:01:51 -07:00
parent 0572a1c97d
commit 797cea4f63
8 changed files with 52 additions and 146 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ const RootQuery = {
// This endpoint is used for loading the user moderation queues (users whose username has been flagged),
// so hide it in the event that we aren't an admin.
async users(_, {query}, {user, loaders: {Users}}) {
users(_, {query}, {user, loaders: {Users}}) {
if (user == null || !user.can(SEARCH_OTHER_USERS)) {
return null;
}
+2 -3
View File
@@ -50,7 +50,7 @@ const User = {
return tokens;
},
async ignoredUsers({id}, args, {user, loaders: {Users}}) {
ignoredUsers({id}, args, {user, loaders: {Users}}) {
// Only allow a logged in user that is either the current user or is a staff
// member to access the ignoredUsers of a given user.
@@ -63,8 +63,7 @@ const User = {
return [];
}
const connection = await Users.getByQuery({ids: user.ignoresUsers});
return connection.nodes;
return Users.getByID.loadMany(user.ignoresUsers);
},
role({id, role}, _, {user}) {