Hyo
12/08/2018, 7:55 AMsignup: async (_, args, context, info) => {
const result = await context.prisma.mutation.createUser(
{
data: {
email: args.email,
},
},
info,
);
return result;
When I change above query to below, Error: Cannot return null for non-nullable field User.id.
error is always throwing. No idea why this is happening.
signup: async (_, args, context, info) => {
const token = jwt.sign({ userId: args.id }, SECRET);
console.log('token: ' + token); // token always has a value!!
const result = await context.prisma.mutation.createUser(
{
data: {
email: args.email,
},
},
info,
);
return {
token,
result,
};
}
Could anyone guide me to this problem?