contrib
contrib copied to clipboard
[entgrpc] fix to get singular name
.EntEdge.StructField
has string value with pascal case so "Children" is stored which cannot be singulerized by the sigular
function that only takes lower case.
.EntEdge.Name
has same string with .EntEdge.StructField
but lower case so "children" is stored; now singular
returns "child". Also it needs to be transformed into pascalcase again.
ref. https://github.com/ent/ent/blob/092b62a3229476d18d9ffade87da268d9136f13a/entc/gen/template/builder/update.tmpl#L207