Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
upsert test
upsert {
query {
getVals(func: has(products)) {
productsUid as uid
products @filter(eq(productId, 19610626)) {
productUid as uid
options @filter(eq(optionId, 32661491)) {
optionUid as uid
}
}
}
}
mutation {
set {
uid(productsUid) <products> uid(productUid) .
uid(productsUid) <dgraph.type> "Products" .
uid(productUid) <productId> "19610626" .
uid(productUid) <options> uid(optionUid) .
uid(productUid) <dgraph.type> "Product" .
uid(optionUid) <color> "blue" .
uid(optionUid) <dgraph.type> "Option" .
uid(optionUid) <optionId> "32661491" .
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment