userByAuthId rootQuery working
This commit is contained in:
1 parent
443c963e3f
commit
4086568e9d
1 file changed
+8
-1
@@ -65,10 +65,17 @@ const RootQuery = new GraphQLObjectType({
|
||||
args: {id: {type: GraphQLID}},
|
||||
resolve(parent,args) {
|
||||
// Code to get data from data source.
|
||||
|
||||
return User.findById(args.id);
|
||||
}
|
||||
},
|
||||
userByAuthId: {
|
||||
type: UserType,
|
||||
args: {authId: {type: GraphQLString}},
|
||||
resolve(parent,args) {
|
||||
// Code to get data from data source.
|
||||
return User.findOne({authId: args.authId});
|
||||
}
|
||||
},
|
||||
role: {
|
||||
type: RoleType,
|
||||
args: {id: {type: GraphQLID}},
|
||||
|
||||
Reference in new issue
Block a user