Actually, if you prefer, you can comment using JSON keys outside the scope of the mutation. Dgraph will simply ignore any key other than “set” or “delete”.
{
"set": [
{"name": "foo"}
],
"COMMENT": "this iss a comment",
"//COMMENT": "this iss a comment",
"#COMMENT": "this iss a comment"
}
The intended usecase was to quickly comment and uncomment blocks of code in the Mutate tab of the Ratel UI. This is handy when testing or exploring Dgraph syntax/features.
If comments aren’t stripped by the UI before being forwarded to Alpha, I suggest removing the shortcut [cmd|ctrl]+/ from the UI, i.e. as a user I thought that mutate comments would work, because the comment shortcut was supported in the Mutate tab of the UI.