func (e BlogPostEdges) CategoriesOrErr() ([]*Category, error) {
	if e.loadedTypes[1] {
		return e.Categories, nil
	}
	return nil, &NotLoadedError{edge: "categories"}
}
CategoriesOrErr returns the Categories value or an error if the edge
was not loaded in eager-loading.
package ent
import (
	"fmt"
	"strings"
	"entgo.io/contrib/entproto/internal/entprototest/ent/blogpost"
	"entgo.io/contrib/entproto/internal/entprototest/ent/user"
	"entgo.io/ent/dialect/sql"
)
type BlogPost struct {
	config `json:"-"`
	ID int `json:"id,omitempty"`
	Title string `json:"title,omitempty"`
	Body string `json:"body,omitempty"`
	ExternalID int `json:"external_id,omitempty"`
	Edges            BlogPostEdges `json:"edges"`
	blog_post_author *int
}
type BlogPostEdges struct {
	Author *User `json:"author,omitempty"`
	Categories []*Category `json:"categories,omitempty"`
	loadedTypes [2]bool
}
func (e BlogPostEdges) AuthorOrErr() (*User, error) {
	if e.loadedTypes[0] {
		if e.Author == nil {
			return nil, &NotFoundError{label: user.Label}
		}
		return e.Author, nil
	}
	return nil, &NotLoadedError{edge: "author"}
}