func (c *Category) QueryTodos() *TodoQuery {
	return (&CategoryClient{config: c.config}).QueryTodos(c)
}
QueryTodos queries the "todos" edge of the Category entity.
package ent
import (
	"fmt"
	"strings"
	"time"
	"entgo.io/contrib/entgql/internal/todo/ent/category"
	"entgo.io/contrib/entgql/internal/todo/ent/schema/schematype"
	"entgo.io/ent/dialect/sql"
)
type Category struct {
	config `json:"-"`
	ID int `json:"id,omitempty"`
	Text string `json:"text,omitempty"`
	Status category.Status `json:"status,omitempty"`
	Config *schematype.CategoryConfig `json:"config,omitempty"`
	Duration time.Duration `json:"duration,omitempty"`
	Count uint64 `json:"count,omitempty"`
	Edges CategoryEdges `json:"edges"`
}
type CategoryEdges struct {
	Todos []*Todo `json:"todos,omitempty"`
	loadedTypes [1]bool
}
func (e CategoryEdges) TodosOrErr() ([]*Todo, error) {
	if e.loadedTypes[0] {
		return e.Todos, nil
	}
	return nil, &NotLoadedError{edge: "todos"}
}
func (*Category) scanValues(columns []string) ([]interface{}, error) {
	values := make([]interface{}, len(columns))
	for i := range columns {
		switch columns[i] {
		case category.FieldConfig:
			values[i] = new(schematype.CategoryConfig)
		case category.FieldID, category.FieldDuration, category.FieldCount:
			values[i] = new(sql.NullInt64)
		case category.FieldText, category.FieldStatus:
			values[i] = new(sql.NullString)
		default:
			return nil, fmt.Errorf("unexpected column %q for type Category", columns[i])
		}
	}
	return values, nil
}
func (c *Category) assignValues(columns []string, values []interface{}) error {
	if m, n := len(values), len(columns); m < n {
		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
	}
	for i := range columns {
		switch columns[i] {
		case category.FieldID:
			value, ok := values[i].(*sql.NullInt64)
			if !ok {
				return fmt.Errorf("unexpected type %T for field id", value)
			}
			c.ID = int(value.Int64)
		case category.FieldText:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field text", values[i])
			} else if value.Valid {
				c.Text = value.String
			}
		case category.FieldStatus:
			if value, ok := values[i].(*sql.NullString); !ok {
				return fmt.Errorf("unexpected type %T for field status", values[i])
			} else if value.Valid {
				c.Status = category.Status(value.String)
			}
		case category.FieldConfig:
			if value, ok := values[i].(*schematype.CategoryConfig); !ok {
				return fmt.Errorf("unexpected type %T for field config", values[i])
			} else if value != nil {
				c.Config = value
			}
		case category.FieldDuration:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field duration", values[i])
			} else if value.Valid {
				c.Duration = time.Duration(value.Int64)
			}
		case category.FieldCount:
			if value, ok := values[i].(*sql.NullInt64); !ok {
				return fmt.Errorf("unexpected type %T for field count", values[i])
			} else if value.Valid {
				c.Count = uint64(value.Int64)
			}
		}
	}
	return nil
}