First returns the first FsEvent entity from the query. Returns a *NotFoundError when no FsEvent was found.
(ctx context.Context)
| 84 | // First returns the first FsEvent entity from the query. |
| 85 | // Returns a *NotFoundError when no FsEvent was found. |
| 86 | func (feq *FsEventQuery) First(ctx context.Context) (*FsEvent, error) { |
| 87 | nodes, err := feq.Limit(1).All(setContextOp(ctx, feq.ctx, "First")) |
| 88 | if err != nil { |
| 89 | return nil, err |
| 90 | } |
| 91 | if len(nodes) == 0 { |
| 92 | return nil, &NotFoundError{fsevent.Label} |
| 93 | } |
| 94 | return nodes[0], nil |
| 95 | } |
| 96 | |
| 97 | // FirstX is like First, but panics if an error occurs. |
| 98 | func (feq *FsEventQuery) FirstX(ctx context.Context) *FsEvent { |
no test coverage detected