Create slug based on title field.

I currently have a product schema that has title field that is a nonNull text. I want to create a slug that is automatically generated. My current approach to this is using the .$defaultFn((title) => createSlug(title)) but I am struggling to find a way to reference title in the defaultFn. Is there some way to do this?
Was this page helpful?