MichelDiz commented :
This is a kind of duplicated of #4615
But, not sure what would be the best approach.
However, I didn’t understand how it is related to UNWIND Neo4J’s. There seems to be something else entirely.
Also, Internally I had proposed a “custom block”.
{
var() {
# This is a "custom var block" all values here doesn't show up in the query result.
ST as string("Alice") # We could use it in any query help to avoid repetition.
T1 as string($a) # This is getting a value from graphql variable.
Users as uidAt(Var1, var2) # converts UID to hex number to be used in a query, also to work with uid_in function.
Users2 as uidAt("0x1, 0x2") # Just holds UIDs to be used in a query.
DP as math(4) # hold a number or do a math, as we do in our examples in docs
T2 as math($b + 33) # This is getting a value from graphql variable and summing.
DP2 as int(1) #just hold a number
DP3 as float(1.01111) # just hold a float number
DT as dateTime(2006-01-02T15:04:05) # just hold dateTime
}
}
The custom block could be used instead of directly inserting GraphQL Variable into the mutation block.
Just for internal ref Custom Block - Discussion
btw, I think the order in Dgraph syntax would be user_name as unwind $names
It is important to note that Upsert Block does not yet support GraphQL Variables (Also known as Query Variables). We need to support this before doing anything else related.