Created
December 14, 2016 20:59
-
-
Save HERRKIN/f9003cf6a49020ee299199a63feb1181 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Meteor} from 'meteor/meteor' | |
export default function (root, args, context) { | |
// if the user is not logged in throw an error | |
if (!context.userId) { | |
throw new Error('Unknown User (not logged in)') | |
} | |
// find the user using the userId from the context | |
return Meteor.users.findOne(context.userId) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment