Im trying to do simple enrollmente process with apollo mutation.
let userId = Accounts.createUser({email, username: email});
Accounts.sendEnrollmentEmail(userId);
return {
code: 200,
message: bla bla bla
}
inside a mutation. But i got this error: Meteor.userId can only be invoked in method calls or publications.
So i have to use method instead of mutaiton? any idea?
well, its not the problem of mutation, the exception is launched on Accounts.createUser, becouse i skipped the doc which suggested to use nicolaslopezj:apollo-accounts, ooops.
Sorry, i found the problem, i bound a function to Accounts.onCreateUser which gave me that exception, so nicolaslopezj:apollo-accounts was not necessary. Shame on me.