Add todo schema

This commit is contained in:
Achim Rohn
2025-09-18 09:59:40 +02:00
parent b788fb4898
commit 1c42c7dd7a
17 changed files with 2832 additions and 2 deletions
+12
View File
@@ -20,6 +20,18 @@ func (f GoogleAuthFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value,
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.GoogleAuthMutation", m)
}
// The TodoFunc type is an adapter to allow the use of ordinary
// function as Todo mutator.
type TodoFunc func(context.Context, *ent.TodoMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f TodoFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.TodoMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.TodoMutation", m)
}
// The UserFunc type is an adapter to allow the use of ordinary
// function as User mutator.
type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error)