Key not unique in link

i m setting “linkKeyProperty”: “key” but it is not assigning unique keys to the link. the keys assigned are overlapping with the node keys for reference
Screenshot%20from%202019-07-08%2018-25-16

subject area in pic has key =-13
the link labeled comprises of also has key = -13
how to make them unique

You can set up separate functions for Model.makeUniqueKeyFunction and GraphLinksModel.makeUniqueLinkKeyFunction. An example of this is in the Incremental State Chart sample, which uses odd numbers for nodes and even numbers for links.

the problem is i m getting keys from db too that are random integers

for example the inital loading of diagram will gime keys in 100000 while the default keys of diagram are in -1 to so on

Right, so you need to customize the functions to work in a similar manner to the way your db generates keys.

You might also want to set Model | GoJS API to false.