Skip to main content

Relations

To enable read with relations included use annotations.Edge().EnableRead()

your_model_schema.go
// Edges of the Cat.
func (Cat) Edges() []ent.Edge {
return []ent.Edge{
edge.To("kittens", Kitten.Type).Annotations(
annotations.Edge().EnableRead(),
),
}
}