contrib icon indicating copy to clipboard operation
contrib copied to clipboard

[entgrpc] fix to get singular name

Open lesomnus opened this issue 9 months ago • 0 comments

.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

lesomnus avatar May 21 '24 10:05 lesomnus