Why do I have to provide both upstream and downstream edges in GraphQL mutations for DataHub lineage updates?

Original Slack Thread

Is there any way to add via GraphQL only upstream / downstream edges?
Seems like both attributes are required and they do not accept null or empty strings.
What if the table does not have downstream?

0.12.0 versionattachment

Hey there! :wave: Make sure your message includes the following information if relevant, so we can help more effectively!

  1. Which DataHub version are you using? (e.g. 0.12.0)
  2. Please post any relevant error logs on the thread!

you have to provide value to downstreamUrn in edgesToAdd
query looks something like this

 updateLineage(input: {
  edgesToAdd: {
    downstreamUrn: "urn:li:dataset:(urn:li:dataPlatform:redshift,*****1111,PROD)"
    upstreamUrn: "urn:li:dataset:(urn:li:dataPlatform:redshift,******2222,PROD)"
  }
  edgesToRemove: []
})
}```

Seems like I did not explain my question well enough:

Why do I have to provide a downstream edge? What if my table is the final destination and this table does not have anything downstream?
Same vice versa - what if the table has no upstream, it is a source table, why do I have to provide upstream for it?

updateLineage mutation is used to link two entities, among them one is upstream and the other one is downstream. updateLineage will always take two entities as input to link.

Let’s take an example lineage A –>B –> C
> 1. ‘A’ has no upstream, and has downstream ‘B’
> 2. ‘B’ has upstream ‘A’, and downstream ‘C’
> 3. ‘C’ has upstream ‘B’ and no downstream
these two updateLineage are required to construct this lineage

 updateLineage(input: {
  edgesToAdd: {
    upstreamUrn: "A"
    downstreamUrn: "B"
  }
  edgesToRemove: []
})
}```
```mutation updateLinege {
 updateLineage(input: {
  edgesToAdd: {
    upstreamUrn: "B"
    downstreamUrn: "C"
  }
  edgesToRemove: []
})
}```

So basically, one of the streams should point to the current node (either upstream or downstream), meaning first query is mutating A or B, and the second query is mutation B or C
I assumed that when you mutate, the current node is already provided, and you point towards something upstream and something downstream, and the mutated is in the middle…

Thanks, that helps a lot!