(ctx context.Context, req *createGraphRequest)
| 510 | } |
| 511 | |
| 512 | func (s *server) createGraph(ctx context.Context, req *createGraphRequest) (*createGraphResponse, error) { |
| 513 | gID, curTx, err := s.db.CreateGraph(ctx, req.GraphName) |
| 514 | if db.IsAlreadyExists(err) { |
| 515 | return nil, httperr. |
| 516 | Conflict("graph already exists: %w", err). |
| 517 | WithMessage("a graph with that name already exists") |
| 518 | } else if err != nil { |
| 519 | return nil, httperr.Internal("failed to create graph: %w", err) |
| 520 | } |
| 521 | return &createGraphResponse{ |
| 522 | GraphUUID: string(gID), |
| 523 | Txid: int64(curTx), |
| 524 | }, nil |
| 525 | } |
| 526 | |
| 527 | type deleteGraphRequest struct { |
| 528 | GraphUUID string `json:"GraphUUID"` |
nothing calls this directly
no test coverage detected