func (neq *NilExampleQuery) FirstID(ctx context.Context) (id int, err error) {
	var ids []int
	if ids, err = neq.Limit(1).IDs(ctx); err != nil {
		return
	}
	if len(ids) == 0 {
		err = &NotFoundError{nilexample.Label}
		return
	}
	return ids[0], nil
}
FirstID returns the first NilExample ID from the query.
Returns a *NotFoundError when no NilExample ID was found.
package ent
import (
	"context"
	"errors"
	"fmt"
	"math"
	"entgo.io/contrib/entproto/internal/todo/ent/nilexample"
	"entgo.io/contrib/entproto/internal/todo/ent/predicate"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type NilExampleQuery struct {
	config
	limit      *int
	offset     *int
	unique     *bool
	order      []OrderFunc
	fields     []string
	predicates []predicate.NilExample
	sql  *sql.Selector
	path func(context.Context) (*sql.Selector, error)
}
func (neq *NilExampleQuery) Where(ps ...predicate.NilExample) *NilExampleQuery {
	neq.predicates = append(neq.predicates, ps...)
	return neq
}
func (neq *NilExampleQuery) Limit(limit int) *NilExampleQuery {
	neq.limit = &limit
	return neq
}
func (neq *NilExampleQuery) Offset(offset int) *NilExampleQuery {
	neq.offset = &offset
	return neq
}
func (neq *NilExampleQuery) Unique(unique bool) *NilExampleQuery {
	neq.unique = &unique
	return neq
}
func (neq *NilExampleQuery) Order(o ...OrderFunc) *NilExampleQuery {
	neq.order = append(neq.order, o...)
	return neq
}
func (neq *NilExampleQuery) First(ctx context.Context) (*NilExample, error) {
	nodes, err := neq.Limit(1).All(ctx)
	if err != nil {
		return nil, err
	}
	if len(nodes) == 0 {
		return nil, &NotFoundError{nilexample.Label}
	}
	return nodes[0], nil
}
func (neq *NilExampleQuery) FirstX(ctx context.Context) *NilExample {
	node, err := neq.First(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return node
}