From 4086568e9d7b9de840bc92b68ec0daf383bccd15 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 6 Sep 2018 13:27:59 +0200 Subject: [PATCH] userByAuthId rootQuery working --- server/schema/schema.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/schema/schema.js b/server/schema/schema.js index 4590c227b..6947120a6 100644 --- a/server/schema/schema.js +++ b/server/schema/schema.js @@ -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}},