If nodes already exists then query parts will return uid of those and in mutation part where we add “conn” will automatically get skipped. For example if “uuid9” and “fb.com” are already connected then mutation part below get skipped.
upsert {
query {
q(func: eq(idval, "uuid9")) {
u9 as uid
}
q(func: eq(idval, "fb.com")) {
f as uid
}
}
mutation {
set {
uid(u9) <conn> uid(f) .
}
}
I hope this clear your doubt.