Skip to content

Instantly share code, notes, and snippets.

@MichelDiz
Created October 16, 2019 18:58
Show Gist options
  • Save MichelDiz/4e1fee3be8f7c95daeab8e2aff291751 to your computer and use it in GitHub Desktop.
Save MichelDiz/4e1fee3be8f7c95daeab8e2aff291751 to your computer and use it in GitHub Desktop.
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