FirstID returns the first NodeVersion ID from the query. Returns a *NotFoundError when no NodeVersion ID was found.
(ctx context.Context)
| 160 | // FirstID returns the first NodeVersion ID from the query. |
| 161 | // Returns a *NotFoundError when no NodeVersion ID was found. |
| 162 | func (nvq *NodeVersionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) { |
| 163 | var ids []uuid.UUID |
| 164 | if ids, err = nvq.Limit(1).IDs(setContextOp(ctx, nvq.ctx, ent.OpQueryFirstID)); err != nil { |
| 165 | return |
| 166 | } |
| 167 | if len(ids) == 0 { |
| 168 | err = &NotFoundError{nodeversion.Label} |
| 169 | return |
| 170 | } |
| 171 | return ids[0], nil |
| 172 | } |
| 173 | |
| 174 | // FirstIDX is like FirstID, but panics if an error occurs. |
| 175 | func (nvq *NodeVersionQuery) FirstIDX(ctx context.Context) uuid.UUID { |
no test coverage detected