mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
entc/gen: add SetID to predefined mutation methods (#4061)
This commit is contained in:
@@ -1208,7 +1208,7 @@ var mutMethods = func() map[string]bool {
|
||||
// with the mutation methods, prefix the method with "Get".
|
||||
func (f Field) MutationGet() string {
|
||||
name := pascal(f.Name)
|
||||
if mutMethods[name] {
|
||||
if mutMethods[name] || (name == "SetID" && f.typ.ID.UserDefined) {
|
||||
name = "Get" + name
|
||||
}
|
||||
return name
|
||||
|
||||
Reference in New Issue
Block a user