Related to #3059
Just registering my interest in this issue/feature as I'd like to be able to do something like the example below.
upsert {
query {
author(func: eq(emailAddress, "[email protected]") ) {
authorEmail as uid
}
}
mutation @if(eq(len(authorEmail), 0)) {
set{
_:me <name> "Robert Evans" .
_:me <dgraph.type> "Author" .
_:me <emailAddress> "[email protected]" .
_:commit <commitSha> "42b1817b6a48941304283e6fcb4fab13e6c80980" .
_:commit <collectionId> "96cc6a70-c1d3-11e9-80fd-1d01e09f90e7" .
_:commit <commitSummary> "Fix/docs (#10)" .
_:me <committed> _:commit .
_:commit <committedBy> _:me .
}
}
mutation @if(eq(len(authorEmail), 1)) {
set {
_:commit <commitSha> "42b1817b6a48941304283e6fcb4fab13e6c80980" .
_:commit <collectionId> "96cc6a70-c1d3-11e9-80fd-1d01e09f90e7" .
_:commit <commitSummary> "Fix/docs (#10)" .
_:commit <committedBy> uid(authorEmail) .
uid(authorEmail) <committed> _:commit .
}
}
}
@mangalaman93 I think this is already merged right? So we can close it.
Most helpful comment
Just registering my interest in this issue/feature as I'd like to be able to do something like the example below.
Example