My name is Brandon W. I am a Founder, self-professed Dgraph noob, and lifelong learner.
I have a number of great user stories grounded in Dgraph and I have (attempted to) drink from the firehose that is Dgraph official and GitHub documentation. When it comes to implementation of nodes, I still have a few questions (that may prove basic…). My goal, ultimately, is to better understand Dgraph and learn how it can be implemented as a solution.
What tools exist to directly implement an HTTP (Maybe REST) API/HTTP Function?Ideally to interact directly with Dgraph – response time is critical
Is there a mechanism to copy a node? (Maybe a Mutation?)
Does Dgraph implement any tenets of object-oriented programming?
What mechanisms are there to implement function/method-like functionality within Dgraph?
upsert {
query {
v as var(func: has(age)) {
a1 as age #You have to copy predicate by predicate
}
}
me() {
a as sum(val(a1))
}
mutation {
# we copy the values from the old predicate and add to the new node
set {
_:newNode <other> val(a) .
}
# and optionally we delete the old predicate
delete {
uid(v) <age> * .
}
}
}
If you are talking about the query language, there’s non. You can’t create your own methods or something. But with GraphQL you can do something like this.