func (vsq *VerySecretQuery) Only(ctx context.Context) (*VerySecret, error) {
	nodes, err := vsq.Limit(2).All(ctx)
	if err != nil {
		return nil, err
	}
	switch len(nodes) {
	case 1:
		return nodes[0], nil
	case 0:
		return nil, &NotFoundError{verysecret.Label}
	default:
		return nil, &NotSingularError{verysecret.Label}
	}
}
Only returns a single VerySecret entity found by the query, ensuring it only returns one.
Returns a *NotSingularError when exactly one VerySecret entity is not found.
Returns a *NotFoundError when no VerySecret entities are found.
package ent
import (
	"context"
	"errors"
	"fmt"
	"math"
	"entgo.io/contrib/entgql/internal/todo/ent/predicate"
	"entgo.io/contrib/entgql/internal/todo/ent/verysecret"
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type VerySecretQuery struct {
	config
	limit      *int
	offset     *int
	unique     *bool
	order      []OrderFunc
	fields     []string
	predicates []predicate.VerySecret
	sql  *sql.Selector
	path func(context.Context) (*sql.Selector, error)
}
func (vsq *VerySecretQuery) Where(ps ...predicate.VerySecret) *VerySecretQuery {
	vsq.predicates = append(vsq.predicates, ps...)
	return vsq
}
func (vsq *VerySecretQuery) Limit(limit int) *VerySecretQuery {
	vsq.limit = &limit
	return vsq
}
func (vsq *VerySecretQuery) Offset(offset int) *VerySecretQuery {
	vsq.offset = &offset
	return vsq
}
func (vsq *VerySecretQuery) Unique(unique bool) *VerySecretQuery {
	vsq.unique = &unique
	return vsq
}
func (vsq *VerySecretQuery) Order(o ...OrderFunc) *VerySecretQuery {
	vsq.order = append(vsq.order, o...)
	return vsq
}
func (vsq *VerySecretQuery) First(ctx context.Context) (*VerySecret, error) {
	nodes, err := vsq.Limit(1).All(ctx)
	if err != nil {
		return nil, err
	}
	if len(nodes) == 0 {
		return nil, &NotFoundError{verysecret.Label}
	}
	return nodes[0], nil
}
func (vsq *VerySecretQuery) FirstX(ctx context.Context) *VerySecret {
	node, err := vsq.First(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return node
}
func (vsq *VerySecretQuery) FirstID(ctx context.Context) (id int, err error) {
	var ids []int
	if ids, err = vsq.Limit(1).IDs(ctx); err != nil {
		return
	}
	if len(ids) == 0 {
		err = &NotFoundError{verysecret.Label}
		return
	}
	return ids[0], nil
}
func (vsq *VerySecretQuery) FirstIDX(ctx context.Context) int {
	id, err := vsq.FirstID(ctx)
	if err != nil && !IsNotFound(err) {
		panic(err)
	}
	return id
}