How can I append value to a list predicate

I have a schema like below:

type User {
  user_name
  pwd
  projects
}

type Project {
  name
  description
}

user_name: string @index(hash) @upsert .
pwd: password .
projects: [uid] .

name: string @index(hash) @upsert .
description: string .

Now I have a user node <0x9c43>, and a project node <0x8i78>, so how can I append the project node to the user’s projects predicate with upsert using Nquad?

My fault, the document had say about this: list type

So my solution is:

upsert {
  query {
    q(func: eq(user_name, "xxxx")) {
      v as uid
    }
  }

  mutation {
    set {
      uid(v) <projects> <0x9c44> .
    }
  }
}

It will append <0x9c44> to the user’s projects list predicate

Cool that you found the answer :slight_smile: