Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return mutated uids as part of the api.Response #102

Merged
merged 5 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions example_set_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func Example_setObject() {
married: bool .
loc: geo .
dob: datetime .
Friend: [uid] .
type: string .
coords: float .

type Person {
name: string
Expand Down
3 changes: 3 additions & 0 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ func ExampleTxn_Mutate() {
loc: geo .
type: string .
coords: float .
Friends: [uid] .

type Person {
name
Expand Down Expand Up @@ -872,6 +873,7 @@ func ExampleDeleteEdges() {
married: bool .
name: string @lang .
location: string .
Friends: [uid] .

type Person {
name
Expand Down Expand Up @@ -1058,6 +1060,7 @@ func ExampleTxn_Mutate_deleteNode() {
op.Schema = `
age: int .
married: bool .
friends: [uid] .

type Person {
name: string
Expand Down
9 changes: 9 additions & 0 deletions protos/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,19 @@ message Request {
bool commit_now = 13;
}

message Uids {
repeated string uids = 1;
}

message Response {
bytes json = 1;
TxnContext txn = 2;
Latency latency = 3;
// Vars contains a map of variable name => [ uids...] used in mutations. It tells
// the user about which uids were updated/deleted as part of an upsert operation.
map<string, Uids> vars = 4;
// uids contains a mapping of blank_node => uid for the node. It only returns uids
// that were created as part of a mutation.
map<string, string> uids = 12;
}

Expand Down
Loading