I’m working on learning Apollo. I’m looking at the resolvers in the Apollo Meteor Starter kit, and I see this:
export const resolvers = {
Query: {
async user(root, args, context) {
// Only return the current user, for security
if (context.userId === args.id) {
return await Meteor.users.findOne(context.userId);
}
},
},
User: {
emails: ({emails}) => emails,
randomString: () => Random.id(),
}
}
I’m trying to figure out how this works.
-
What is the difference between
Query:
andUser:
? -
What is the difference between
async user()
andUser:{}
?
Thanks very much in advance to all for any info!