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