ReservedPredicateValueLock reports whether pred's value is locked to a trusted writer and, if so, returns the context key (TrustMarker) that authorizes the write. The mutation-value guard rejects a write of a locked predicate when the request context does not carry that marker. pred is matched case
(pred string)
| 784 | // those lookups it does not ParseAttr: the guard passes the bare predicate (no |
| 785 | // namespace separator), matching how IsOtherReservedPredicate is consulted. |
| 786 | func ReservedPredicateValueLock(pred string) (marker any, locked bool) { |
| 787 | reservedNsMu.RLock() |
| 788 | defer reservedNsMu.RUnlock() |
| 789 | marker, locked = reservedNsValueLocked[strings.ToLower(pred)] |
| 790 | return marker, locked |
| 791 | } |
| 792 | |
| 793 | // TODO: rename this map to a better suited name as per its properties. It is not just for GraphQL |
| 794 | // predicates, but for all those which are PreDefined and whose value is not allowed to be mutated |