Sceat commented :
hum i don’t understand how it could result in uid(user) <age> "2025" .
as the following totally works and seems normal for a graph database
according you have 2 nodes as
{ name: "Alice" }
{ name: "Bob" }
executing
upsert {
query {
var(func: has(name)) {
name as name
}
// in the first sequence we find Alice's name
// in the second sequence we find Bob's name
}
mutation {
set {
// so here we have 2 parallel sequence
// one for Alice and one for Bob
uid(name) <surname> val(name) .
}
}
}
would give
{ name: "Alice", surname: "Alice" }
{ name: "Bob", surname: "Bob" }
I used Objects in my exemple because it would be pretty handy but we can simplify by using simple valid types like
user_name AS UNWIND ['Alice', 'Bob']
if the nodes already exist this unwind would give the exact same representation as
q(func: has(name)) { user_name as name }
exept we couldn’t call uid(user_name) with the unwind version as it’s just a string value