Feature request: Directive that indicates that @id fields should be auto-populated on creation

theres currently an open PR that introduces the @default directive: https://github.com/dgraph-io/dgraph/pull/8017

This should be extended for every kind of field IMHO.

E.g. for type String this could be:

type Foo {
    cuid: String! @id @default("cuid")
    uuid: String! @id @default("uuid")
}

This would mark cuid and uuid as optional arguments to addFoo. So you could still override the default, otherwise the specified value/function will be used.

If you like this, make some noise on the PR everybody or contribute yourself!

2 Likes