Can I update fields with the @id directive?

Hey @amaster507

Unfortunately, it seems I’m too dumb for this.

Maybe there was a misunderstanding: I do not want to update the Role but I want to reference it to another Role. Therefore, the GraphQL mutation was working nicely on User.role before.

I was trying something like:

const updateDgraphUser = await dql.mutate(`{
  set {
    <${input.userId}> <User.email> "${input.email}" .
    <${input.userId}> <User.userName> "${input.userName}" .
    <${input.userId}> <User.role.id> "${input.roleId}" .
  }	
}`);

and I get no errors but there is also no update on the User.role field. I I try with upsert I get an error message that there is a bad character somewhere…

I have tried to do the GraphQL mutation for all fields, except for email and do the email field with DQL. This works but this seems a bit of a really dirty hack…