mutation.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. // Code generated by entc, DO NOT EDIT.
  2. package ent
  3. import (
  4. "context"
  5. "errors"
  6. "fmt"
  7. "sync"
  8. "time"
  9. "todo/ent/predicate"
  10. "todo/ent/todo"
  11. "entgo.io/ent"
  12. )
  13. const (
  14. // Operation types.
  15. OpCreate = ent.OpCreate
  16. OpDelete = ent.OpDelete
  17. OpDeleteOne = ent.OpDeleteOne
  18. OpUpdate = ent.OpUpdate
  19. OpUpdateOne = ent.OpUpdateOne
  20. // Node types.
  21. TypeTodo = "Todo"
  22. )
  23. // TodoMutation represents an operation that mutates the Todo nodes in the graph.
  24. type TodoMutation struct {
  25. config
  26. op Op
  27. typ string
  28. id *int
  29. text *string
  30. created_at *time.Time
  31. status *todo.Status
  32. priority *int
  33. addpriority *int
  34. clearedFields map[string]struct{}
  35. children map[int]struct{}
  36. removedchildren map[int]struct{}
  37. clearedchildren bool
  38. parent *int
  39. clearedparent bool
  40. done bool
  41. oldValue func(context.Context) (*Todo, error)
  42. predicates []predicate.Todo
  43. }
  44. var _ ent.Mutation = (*TodoMutation)(nil)
  45. // todoOption allows management of the mutation configuration using functional options.
  46. type todoOption func(*TodoMutation)
  47. // newTodoMutation creates new mutation for the Todo entity.
  48. func newTodoMutation(c config, op Op, opts ...todoOption) *TodoMutation {
  49. m := &TodoMutation{
  50. config: c,
  51. op: op,
  52. typ: TypeTodo,
  53. clearedFields: make(map[string]struct{}),
  54. }
  55. for _, opt := range opts {
  56. opt(m)
  57. }
  58. return m
  59. }
  60. // withTodoID sets the ID field of the mutation.
  61. func withTodoID(id int) todoOption {
  62. return func(m *TodoMutation) {
  63. var (
  64. err error
  65. once sync.Once
  66. value *Todo
  67. )
  68. m.oldValue = func(ctx context.Context) (*Todo, error) {
  69. once.Do(func() {
  70. if m.done {
  71. err = errors.New("querying old values post mutation is not allowed")
  72. } else {
  73. value, err = m.Client().Todo.Get(ctx, id)
  74. }
  75. })
  76. return value, err
  77. }
  78. m.id = &id
  79. }
  80. }
  81. // withTodo sets the old Todo of the mutation.
  82. func withTodo(node *Todo) todoOption {
  83. return func(m *TodoMutation) {
  84. m.oldValue = func(context.Context) (*Todo, error) {
  85. return node, nil
  86. }
  87. m.id = &node.ID
  88. }
  89. }
  90. // Client returns a new `ent.Client` from the mutation. If the mutation was
  91. // executed in a transaction (ent.Tx), a transactional client is returned.
  92. func (m TodoMutation) Client() *Client {
  93. client := &Client{config: m.config}
  94. client.init()
  95. return client
  96. }
  97. // Tx returns an `ent.Tx` for mutations that were executed in transactions;
  98. // it returns an error otherwise.
  99. func (m TodoMutation) Tx() (*Tx, error) {
  100. if _, ok := m.driver.(*txDriver); !ok {
  101. return nil, errors.New("ent: mutation is not running in a transaction")
  102. }
  103. tx := &Tx{config: m.config}
  104. tx.init()
  105. return tx, nil
  106. }
  107. // ID returns the ID value in the mutation. Note that the ID is only available
  108. // if it was provided to the builder or after it was returned from the database.
  109. func (m *TodoMutation) ID() (id int, exists bool) {
  110. if m.id == nil {
  111. return
  112. }
  113. return *m.id, true
  114. }
  115. // IDs queries the database and returns the entity ids that match the mutation's predicate.
  116. // That means, if the mutation is applied within a transaction with an isolation level such
  117. // as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
  118. // or updated by the mutation.
  119. func (m *TodoMutation) IDs(ctx context.Context) ([]int, error) {
  120. switch {
  121. case m.op.Is(OpUpdateOne | OpDeleteOne):
  122. id, exists := m.ID()
  123. if exists {
  124. return []int{id}, nil
  125. }
  126. fallthrough
  127. case m.op.Is(OpUpdate | OpDelete):
  128. return m.Client().Todo.Query().Where(m.predicates...).IDs(ctx)
  129. default:
  130. return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
  131. }
  132. }
  133. // SetText sets the "text" field.
  134. func (m *TodoMutation) SetText(s string) {
  135. m.text = &s
  136. }
  137. // Text returns the value of the "text" field in the mutation.
  138. func (m *TodoMutation) Text() (r string, exists bool) {
  139. v := m.text
  140. if v == nil {
  141. return
  142. }
  143. return *v, true
  144. }
  145. // OldText returns the old "text" field's value of the Todo entity.
  146. // If the Todo object wasn't provided to the builder, the object is fetched from the database.
  147. // An error is returned if the mutation operation is not UpdateOne, or the database query fails.
  148. func (m *TodoMutation) OldText(ctx context.Context) (v string, err error) {
  149. if !m.op.Is(OpUpdateOne) {
  150. return v, errors.New("OldText is only allowed on UpdateOne operations")
  151. }
  152. if m.id == nil || m.oldValue == nil {
  153. return v, errors.New("OldText requires an ID field in the mutation")
  154. }
  155. oldValue, err := m.oldValue(ctx)
  156. if err != nil {
  157. return v, fmt.Errorf("querying old value for OldText: %w", err)
  158. }
  159. return oldValue.Text, nil
  160. }
  161. // ResetText resets all changes to the "text" field.
  162. func (m *TodoMutation) ResetText() {
  163. m.text = nil
  164. }
  165. // SetCreatedAt sets the "created_at" field.
  166. func (m *TodoMutation) SetCreatedAt(t time.Time) {
  167. m.created_at = &t
  168. }
  169. // CreatedAt returns the value of the "created_at" field in the mutation.
  170. func (m *TodoMutation) CreatedAt() (r time.Time, exists bool) {
  171. v := m.created_at
  172. if v == nil {
  173. return
  174. }
  175. return *v, true
  176. }
  177. // OldCreatedAt returns the old "created_at" field's value of the Todo entity.
  178. // If the Todo object wasn't provided to the builder, the object is fetched from the database.
  179. // An error is returned if the mutation operation is not UpdateOne, or the database query fails.
  180. func (m *TodoMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
  181. if !m.op.Is(OpUpdateOne) {
  182. return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
  183. }
  184. if m.id == nil || m.oldValue == nil {
  185. return v, errors.New("OldCreatedAt requires an ID field in the mutation")
  186. }
  187. oldValue, err := m.oldValue(ctx)
  188. if err != nil {
  189. return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
  190. }
  191. return oldValue.CreatedAt, nil
  192. }
  193. // ResetCreatedAt resets all changes to the "created_at" field.
  194. func (m *TodoMutation) ResetCreatedAt() {
  195. m.created_at = nil
  196. }
  197. // SetStatus sets the "status" field.
  198. func (m *TodoMutation) SetStatus(t todo.Status) {
  199. m.status = &t
  200. }
  201. // Status returns the value of the "status" field in the mutation.
  202. func (m *TodoMutation) Status() (r todo.Status, exists bool) {
  203. v := m.status
  204. if v == nil {
  205. return
  206. }
  207. return *v, true
  208. }
  209. // OldStatus returns the old "status" field's value of the Todo entity.
  210. // If the Todo object wasn't provided to the builder, the object is fetched from the database.
  211. // An error is returned if the mutation operation is not UpdateOne, or the database query fails.
  212. func (m *TodoMutation) OldStatus(ctx context.Context) (v todo.Status, err error) {
  213. if !m.op.Is(OpUpdateOne) {
  214. return v, errors.New("OldStatus is only allowed on UpdateOne operations")
  215. }
  216. if m.id == nil || m.oldValue == nil {
  217. return v, errors.New("OldStatus requires an ID field in the mutation")
  218. }
  219. oldValue, err := m.oldValue(ctx)
  220. if err != nil {
  221. return v, fmt.Errorf("querying old value for OldStatus: %w", err)
  222. }
  223. return oldValue.Status, nil
  224. }
  225. // ResetStatus resets all changes to the "status" field.
  226. func (m *TodoMutation) ResetStatus() {
  227. m.status = nil
  228. }
  229. // SetPriority sets the "priority" field.
  230. func (m *TodoMutation) SetPriority(i int) {
  231. m.priority = &i
  232. m.addpriority = nil
  233. }
  234. // Priority returns the value of the "priority" field in the mutation.
  235. func (m *TodoMutation) Priority() (r int, exists bool) {
  236. v := m.priority
  237. if v == nil {
  238. return
  239. }
  240. return *v, true
  241. }
  242. // OldPriority returns the old "priority" field's value of the Todo entity.
  243. // If the Todo object wasn't provided to the builder, the object is fetched from the database.
  244. // An error is returned if the mutation operation is not UpdateOne, or the database query fails.
  245. func (m *TodoMutation) OldPriority(ctx context.Context) (v int, err error) {
  246. if !m.op.Is(OpUpdateOne) {
  247. return v, errors.New("OldPriority is only allowed on UpdateOne operations")
  248. }
  249. if m.id == nil || m.oldValue == nil {
  250. return v, errors.New("OldPriority requires an ID field in the mutation")
  251. }
  252. oldValue, err := m.oldValue(ctx)
  253. if err != nil {
  254. return v, fmt.Errorf("querying old value for OldPriority: %w", err)
  255. }
  256. return oldValue.Priority, nil
  257. }
  258. // AddPriority adds i to the "priority" field.
  259. func (m *TodoMutation) AddPriority(i int) {
  260. if m.addpriority != nil {
  261. *m.addpriority += i
  262. } else {
  263. m.addpriority = &i
  264. }
  265. }
  266. // AddedPriority returns the value that was added to the "priority" field in this mutation.
  267. func (m *TodoMutation) AddedPriority() (r int, exists bool) {
  268. v := m.addpriority
  269. if v == nil {
  270. return
  271. }
  272. return *v, true
  273. }
  274. // ResetPriority resets all changes to the "priority" field.
  275. func (m *TodoMutation) ResetPriority() {
  276. m.priority = nil
  277. m.addpriority = nil
  278. }
  279. // AddChildIDs adds the "children" edge to the Todo entity by ids.
  280. func (m *TodoMutation) AddChildIDs(ids ...int) {
  281. if m.children == nil {
  282. m.children = make(map[int]struct{})
  283. }
  284. for i := range ids {
  285. m.children[ids[i]] = struct{}{}
  286. }
  287. }
  288. // ClearChildren clears the "children" edge to the Todo entity.
  289. func (m *TodoMutation) ClearChildren() {
  290. m.clearedchildren = true
  291. }
  292. // ChildrenCleared reports if the "children" edge to the Todo entity was cleared.
  293. func (m *TodoMutation) ChildrenCleared() bool {
  294. return m.clearedchildren
  295. }
  296. // RemoveChildIDs removes the "children" edge to the Todo entity by IDs.
  297. func (m *TodoMutation) RemoveChildIDs(ids ...int) {
  298. if m.removedchildren == nil {
  299. m.removedchildren = make(map[int]struct{})
  300. }
  301. for i := range ids {
  302. delete(m.children, ids[i])
  303. m.removedchildren[ids[i]] = struct{}{}
  304. }
  305. }
  306. // RemovedChildren returns the removed IDs of the "children" edge to the Todo entity.
  307. func (m *TodoMutation) RemovedChildrenIDs() (ids []int) {
  308. for id := range m.removedchildren {
  309. ids = append(ids, id)
  310. }
  311. return
  312. }
  313. // ChildrenIDs returns the "children" edge IDs in the mutation.
  314. func (m *TodoMutation) ChildrenIDs() (ids []int) {
  315. for id := range m.children {
  316. ids = append(ids, id)
  317. }
  318. return
  319. }
  320. // ResetChildren resets all changes to the "children" edge.
  321. func (m *TodoMutation) ResetChildren() {
  322. m.children = nil
  323. m.clearedchildren = false
  324. m.removedchildren = nil
  325. }
  326. // SetParentID sets the "parent" edge to the Todo entity by id.
  327. func (m *TodoMutation) SetParentID(id int) {
  328. m.parent = &id
  329. }
  330. // ClearParent clears the "parent" edge to the Todo entity.
  331. func (m *TodoMutation) ClearParent() {
  332. m.clearedparent = true
  333. }
  334. // ParentCleared reports if the "parent" edge to the Todo entity was cleared.
  335. func (m *TodoMutation) ParentCleared() bool {
  336. return m.clearedparent
  337. }
  338. // ParentID returns the "parent" edge ID in the mutation.
  339. func (m *TodoMutation) ParentID() (id int, exists bool) {
  340. if m.parent != nil {
  341. return *m.parent, true
  342. }
  343. return
  344. }
  345. // ParentIDs returns the "parent" edge IDs in the mutation.
  346. // Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use
  347. // ParentID instead. It exists only for internal usage by the builders.
  348. func (m *TodoMutation) ParentIDs() (ids []int) {
  349. if id := m.parent; id != nil {
  350. ids = append(ids, *id)
  351. }
  352. return
  353. }
  354. // ResetParent resets all changes to the "parent" edge.
  355. func (m *TodoMutation) ResetParent() {
  356. m.parent = nil
  357. m.clearedparent = false
  358. }
  359. // Where appends a list predicates to the TodoMutation builder.
  360. func (m *TodoMutation) Where(ps ...predicate.Todo) {
  361. m.predicates = append(m.predicates, ps...)
  362. }
  363. // Op returns the operation name.
  364. func (m *TodoMutation) Op() Op {
  365. return m.op
  366. }
  367. // Type returns the node type of this mutation (Todo).
  368. func (m *TodoMutation) Type() string {
  369. return m.typ
  370. }
  371. // Fields returns all fields that were changed during this mutation. Note that in
  372. // order to get all numeric fields that were incremented/decremented, call
  373. // AddedFields().
  374. func (m *TodoMutation) Fields() []string {
  375. fields := make([]string, 0, 4)
  376. if m.text != nil {
  377. fields = append(fields, todo.FieldText)
  378. }
  379. if m.created_at != nil {
  380. fields = append(fields, todo.FieldCreatedAt)
  381. }
  382. if m.status != nil {
  383. fields = append(fields, todo.FieldStatus)
  384. }
  385. if m.priority != nil {
  386. fields = append(fields, todo.FieldPriority)
  387. }
  388. return fields
  389. }
  390. // Field returns the value of a field with the given name. The second boolean
  391. // return value indicates that this field was not set, or was not defined in the
  392. // schema.
  393. func (m *TodoMutation) Field(name string) (ent.Value, bool) {
  394. switch name {
  395. case todo.FieldText:
  396. return m.Text()
  397. case todo.FieldCreatedAt:
  398. return m.CreatedAt()
  399. case todo.FieldStatus:
  400. return m.Status()
  401. case todo.FieldPriority:
  402. return m.Priority()
  403. }
  404. return nil, false
  405. }
  406. // OldField returns the old value of the field from the database. An error is
  407. // returned if the mutation operation is not UpdateOne, or the query to the
  408. // database failed.
  409. func (m *TodoMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
  410. switch name {
  411. case todo.FieldText:
  412. return m.OldText(ctx)
  413. case todo.FieldCreatedAt:
  414. return m.OldCreatedAt(ctx)
  415. case todo.FieldStatus:
  416. return m.OldStatus(ctx)
  417. case todo.FieldPriority:
  418. return m.OldPriority(ctx)
  419. }
  420. return nil, fmt.Errorf("unknown Todo field %s", name)
  421. }
  422. // SetField sets the value of a field with the given name. It returns an error if
  423. // the field is not defined in the schema, or if the type mismatched the field
  424. // type.
  425. func (m *TodoMutation) SetField(name string, value ent.Value) error {
  426. switch name {
  427. case todo.FieldText:
  428. v, ok := value.(string)
  429. if !ok {
  430. return fmt.Errorf("unexpected type %T for field %s", value, name)
  431. }
  432. m.SetText(v)
  433. return nil
  434. case todo.FieldCreatedAt:
  435. v, ok := value.(time.Time)
  436. if !ok {
  437. return fmt.Errorf("unexpected type %T for field %s", value, name)
  438. }
  439. m.SetCreatedAt(v)
  440. return nil
  441. case todo.FieldStatus:
  442. v, ok := value.(todo.Status)
  443. if !ok {
  444. return fmt.Errorf("unexpected type %T for field %s", value, name)
  445. }
  446. m.SetStatus(v)
  447. return nil
  448. case todo.FieldPriority:
  449. v, ok := value.(int)
  450. if !ok {
  451. return fmt.Errorf("unexpected type %T for field %s", value, name)
  452. }
  453. m.SetPriority(v)
  454. return nil
  455. }
  456. return fmt.Errorf("unknown Todo field %s", name)
  457. }
  458. // AddedFields returns all numeric fields that were incremented/decremented during
  459. // this mutation.
  460. func (m *TodoMutation) AddedFields() []string {
  461. var fields []string
  462. if m.addpriority != nil {
  463. fields = append(fields, todo.FieldPriority)
  464. }
  465. return fields
  466. }
  467. // AddedField returns the numeric value that was incremented/decremented on a field
  468. // with the given name. The second boolean return value indicates that this field
  469. // was not set, or was not defined in the schema.
  470. func (m *TodoMutation) AddedField(name string) (ent.Value, bool) {
  471. switch name {
  472. case todo.FieldPriority:
  473. return m.AddedPriority()
  474. }
  475. return nil, false
  476. }
  477. // AddField adds the value to the field with the given name. It returns an error if
  478. // the field is not defined in the schema, or if the type mismatched the field
  479. // type.
  480. func (m *TodoMutation) AddField(name string, value ent.Value) error {
  481. switch name {
  482. case todo.FieldPriority:
  483. v, ok := value.(int)
  484. if !ok {
  485. return fmt.Errorf("unexpected type %T for field %s", value, name)
  486. }
  487. m.AddPriority(v)
  488. return nil
  489. }
  490. return fmt.Errorf("unknown Todo numeric field %s", name)
  491. }
  492. // ClearedFields returns all nullable fields that were cleared during this
  493. // mutation.
  494. func (m *TodoMutation) ClearedFields() []string {
  495. return nil
  496. }
  497. // FieldCleared returns a boolean indicating if a field with the given name was
  498. // cleared in this mutation.
  499. func (m *TodoMutation) FieldCleared(name string) bool {
  500. _, ok := m.clearedFields[name]
  501. return ok
  502. }
  503. // ClearField clears the value of the field with the given name. It returns an
  504. // error if the field is not defined in the schema.
  505. func (m *TodoMutation) ClearField(name string) error {
  506. return fmt.Errorf("unknown Todo nullable field %s", name)
  507. }
  508. // ResetField resets all changes in the mutation for the field with the given name.
  509. // It returns an error if the field is not defined in the schema.
  510. func (m *TodoMutation) ResetField(name string) error {
  511. switch name {
  512. case todo.FieldText:
  513. m.ResetText()
  514. return nil
  515. case todo.FieldCreatedAt:
  516. m.ResetCreatedAt()
  517. return nil
  518. case todo.FieldStatus:
  519. m.ResetStatus()
  520. return nil
  521. case todo.FieldPriority:
  522. m.ResetPriority()
  523. return nil
  524. }
  525. return fmt.Errorf("unknown Todo field %s", name)
  526. }
  527. // AddedEdges returns all edge names that were set/added in this mutation.
  528. func (m *TodoMutation) AddedEdges() []string {
  529. edges := make([]string, 0, 2)
  530. if m.children != nil {
  531. edges = append(edges, todo.EdgeChildren)
  532. }
  533. if m.parent != nil {
  534. edges = append(edges, todo.EdgeParent)
  535. }
  536. return edges
  537. }
  538. // AddedIDs returns all IDs (to other nodes) that were added for the given edge
  539. // name in this mutation.
  540. func (m *TodoMutation) AddedIDs(name string) []ent.Value {
  541. switch name {
  542. case todo.EdgeChildren:
  543. ids := make([]ent.Value, 0, len(m.children))
  544. for id := range m.children {
  545. ids = append(ids, id)
  546. }
  547. return ids
  548. case todo.EdgeParent:
  549. if id := m.parent; id != nil {
  550. return []ent.Value{*id}
  551. }
  552. }
  553. return nil
  554. }
  555. // RemovedEdges returns all edge names that were removed in this mutation.
  556. func (m *TodoMutation) RemovedEdges() []string {
  557. edges := make([]string, 0, 2)
  558. if m.removedchildren != nil {
  559. edges = append(edges, todo.EdgeChildren)
  560. }
  561. return edges
  562. }
  563. // RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
  564. // the given name in this mutation.
  565. func (m *TodoMutation) RemovedIDs(name string) []ent.Value {
  566. switch name {
  567. case todo.EdgeChildren:
  568. ids := make([]ent.Value, 0, len(m.removedchildren))
  569. for id := range m.removedchildren {
  570. ids = append(ids, id)
  571. }
  572. return ids
  573. }
  574. return nil
  575. }
  576. // ClearedEdges returns all edge names that were cleared in this mutation.
  577. func (m *TodoMutation) ClearedEdges() []string {
  578. edges := make([]string, 0, 2)
  579. if m.clearedchildren {
  580. edges = append(edges, todo.EdgeChildren)
  581. }
  582. if m.clearedparent {
  583. edges = append(edges, todo.EdgeParent)
  584. }
  585. return edges
  586. }
  587. // EdgeCleared returns a boolean which indicates if the edge with the given name
  588. // was cleared in this mutation.
  589. func (m *TodoMutation) EdgeCleared(name string) bool {
  590. switch name {
  591. case todo.EdgeChildren:
  592. return m.clearedchildren
  593. case todo.EdgeParent:
  594. return m.clearedparent
  595. }
  596. return false
  597. }
  598. // ClearEdge clears the value of the edge with the given name. It returns an error
  599. // if that edge is not defined in the schema.
  600. func (m *TodoMutation) ClearEdge(name string) error {
  601. switch name {
  602. case todo.EdgeParent:
  603. m.ClearParent()
  604. return nil
  605. }
  606. return fmt.Errorf("unknown Todo unique edge %s", name)
  607. }
  608. // ResetEdge resets all changes to the edge with the given name in this mutation.
  609. // It returns an error if the edge is not defined in the schema.
  610. func (m *TodoMutation) ResetEdge(name string) error {
  611. switch name {
  612. case todo.EdgeChildren:
  613. m.ResetChildren()
  614. return nil
  615. case todo.EdgeParent:
  616. m.ResetParent()
  617. return nil
  618. }
  619. return fmt.Errorf("unknown Todo edge %s", name)
  620. }