Skip to content

Commit

Permalink
chore: raise exception when id passed to deleteProject and archivePro…
Browse files Browse the repository at this point in the history
…ject mutations corresponds to a non-Project node
  • Loading branch information
axiomofjoy committed Mar 15, 2024
1 parent 6b6fdd1 commit cdba9d2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/phoenix/server/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ def delete_project(self, info: Info[Context, None], id: GlobalID) -> Query:
return Query()
type_name, node_id = from_global_id(str(id))
if type_name != "Project":
return Query()
raise ValueError(
"The id passed to deleteProject must correspond to a node of type Project, "
f"but was passed a node of type: {type_name}"
)
traces.archive_project(node_id)
return Query()

Expand All @@ -244,7 +247,10 @@ def archive_project(self, info: Info[Context, None], id: GlobalID) -> Query:
return Query()
type_name, node_id = from_global_id(str(id))
if type_name != "Project":
return Query()
raise ValueError(
"The id passed to archiveProject must correspond to a node of type Project, "
f"but was passed a node of type: {type_name}"
)
traces.archive_project(node_id)
return Query()

Expand Down

0 comments on commit cdba9d2

Please sign in to comment.