Descendants on GraphQL
This commit is contained in:
1 parent
831acae792
commit
74ea914045
1 file changed
+8
-1
@@ -144,7 +144,14 @@ const RootQuery = new GraphQLObjectType({
|
||||
|
||||
if (mongoQuery.$or.length === 0) { mongoQuery = {} }
|
||||
|
||||
return User.find(mongoQuery)
|
||||
return User.find([mongoQuery])
|
||||
}
|
||||
},
|
||||
descendents: {
|
||||
type: new GraphQLList(UserType),
|
||||
args: {id: {type: GraphQLString}},
|
||||
resolve (parent, args) {
|
||||
return User.find({referrerId: args.id})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user