Enforce one field based on another - kebab-case example

Hey, try setting the Dgraph lambda as follows :

function nameKebab({parent: {name} }) {
  console.log('nameKebab called');
  return name.replace(/\s/g,"-").toLowerCase()
}

self.addGraphQLResolvers({
    "Post.nameKebab": nameKebab
});

Following is the result after doing a call on the lambda :

{
          "id": "0x186a2",
          "name": "Please DON'T skewer me uwu",
          "nameKebab": "please-don't-skewer-me-uwu"
}