I'd like to autofill a "userId" field when an object of this type is created.
type FriendRequest @model
@key(fields: ["userId", "receiver"])
{
userId: ID!
receiver: ID!
}
How would this be done? Would I need an @function directive on the userId field? What would that function look like?