I have Laravel 8 with Lighthouse package for Graph QL,
I have added @unique directive for "name" attribute, but I am unable to apply this while updating any record, as I want to skip the currently updating record for checking unique,
Below is schema for update
updateRole(id: ID, name: String! @trim @rules(apply : ["unique:roles,name"]), isActive: Int!): Role! @update
When I manually added "id" with rule, it works fine, but I don't know how to make it dynamic rule.