func And(first, second Condition, rest ...Condition) Condition {
	return func(ctx context.Context, m ent.Mutation) bool {
		if !first(ctx, m) || !second(ctx, m) {
			return false
		}
		for _, cond := range rest {
			if !cond(ctx, m) {
				return false
			}
		}
		return true
	}
}
And groups conditions with the AND operator.
package hook
import (
	"context"
	"fmt"
	"entgo.io/contrib/entgql/internal/todo/ent"
)
type CategoryFunc func(context.Context, *ent.CategoryMutation) (ent.Value, error)
func (f CategoryFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
	mv, ok := m.(*ent.CategoryMutation)
	if !ok {
		return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.CategoryMutation", m)
	}
	return f(ctx, mv)
}
type TodoFunc func(context.Context, *ent.TodoMutation) (ent.Value, error)
func (f TodoFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
	mv, ok := m.(*ent.TodoMutation)
	if !ok {
		return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.TodoMutation", m)
	}
	return f(ctx, mv)
}
type VerySecretFunc func(context.Context, *ent.VerySecretMutation) (ent.Value, error)
func (f VerySecretFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
	mv, ok := m.(*ent.VerySecretMutation)
	if !ok {
		return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.VerySecretMutation", m)
	}
	return f(ctx, mv)
}
type Condition func(context.Context, ent.Mutation) bool