userByAuthId rootQuery working

This commit is contained in:
Luis Fernando Molina committed 2018-09-06 13:27:59 +02:00
1 parent 443c963e3f
commit 4086568e9d
1 file changed
+8 -1
+8 -1
View File
@@ -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}},