Upsert with multiple UIDs

As you’re using the Upsert Block. It means you’re using the variables in the mutation part of that block. e.g: .setSetNquads(ByteString.copyFromUtf8("uid(productsUid) <products> uid(productUid) ."))
So you need to define those variables in the query tho. Tha variables are “productsUid, productUid, optionUid”. That’s why you got this error. So you query should look like:

{
  getVals(func: has(products)) {
    productsUid as uid
  	products @filter(eq(productId, 19610626)) {
      productUid  as uid
      options @filter(eq(optionId, 32661491)) {
        optionUid as uid
      }
    }
  }
}
1 Like