Skip to content

Commit 5f12437

Browse files
lb-pnocursoragent
andcommitted
Add experimental=True to all @internal issue management GraphQL operations
All issue, comment, and issue category queries/mutations are marked @internal in the backend schema and must be routed to the /_gql endpoint. Without experimental=True the SDK was hitting /graphql where these fields do not exist, causing InvalidQueryError failures. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d295441 commit 5f12437

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

libs/labelbox/src/labelbox/schema/issue.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def update(self, content: str) -> "Comment":
139139
"where": {"id": self.id},
140140
"data": {"content": content},
141141
},
142+
experimental=True,
142143
)
143144
return _parse_comment(self.client, result["updateComment"])
144145

@@ -154,7 +155,9 @@ def delete(self) -> bool:
154155
deleteComment(where: $where) { id }
155156
}"""
156157

157-
self.client.execute(query_str, {"where": {"id": self.id}})
158+
self.client.execute(
159+
query_str, {"where": {"id": self.id}}, experimental=True
160+
)
158161
return True
159162

160163

@@ -228,7 +231,9 @@ def comments(self) -> List[Comment]:
228231
% _COMMENT_FIELDS
229232
)
230233

231-
result = self.client.execute(query_str, {"where": {"id": self.id}})
234+
result = self.client.execute(
235+
query_str, {"where": {"id": self.id}}, experimental=True
236+
)
232237
raw_comments = result.get("issue", {}).get("comments", [])
233238
return [_parse_comment(self.client, c) for c in raw_comments]
234239

@@ -257,7 +262,9 @@ def category(self) -> Optional[IssueCategory]:
257262
}
258263
}"""
259264

260-
result = self.client.execute(query_str, {"where": {"id": self.id}})
265+
result = self.client.execute(
266+
query_str, {"where": {"id": self.id}}, experimental=True
267+
)
261268
raw = result.get("issue", {}).get("category")
262269
if raw is None:
263270
return None
@@ -329,6 +336,7 @@ def update(
329336
result = self.client.execute(
330337
query_str,
331338
{"where": {"id": self.id}, "data": data},
339+
experimental=True,
332340
)
333341
return _parse_issue(self.client, result["updateIssue"])
334342

@@ -345,6 +353,7 @@ def delete(self) -> bool:
345353
self.client.execute(
346354
query_str,
347355
{"data": {"issueIds": [self.id]}},
356+
experimental=True,
348357
)
349358
return True
350359

@@ -361,7 +370,9 @@ def resolve(self) -> "Issue":
361370
% _ISSUE_FIELDS
362371
)
363372

364-
result = self.client.execute(query_str, {"where": {"id": self.id}})
373+
result = self.client.execute(
374+
query_str, {"where": {"id": self.id}}, experimental=True
375+
)
365376
return _parse_issue(self.client, result["resolveIssue"])
366377

367378
def reopen(self) -> "Issue":
@@ -377,7 +388,9 @@ def reopen(self) -> "Issue":
377388
% _ISSUE_FIELDS
378389
)
379390

380-
result = self.client.execute(query_str, {"where": {"id": self.id}})
391+
result = self.client.execute(
392+
query_str, {"where": {"id": self.id}}, experimental=True
393+
)
381394
return _parse_issue(self.client, result["openIssue"])
382395

383396
def create_comment(self, content: str) -> Comment:
@@ -399,6 +412,7 @@ def create_comment(self, content: str) -> Comment:
399412
result = self.client.execute(
400413
query_str,
401414
{"data": {"content": content, "issueId": self.id}},
415+
experimental=True,
402416
)
403417
return _parse_comment(self.client, result["createComment"])
404418

libs/labelbox/src/labelbox/schema/issue_category.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def update(self, name: str, description: str) -> "IssueCategory":
5656
"where": {"id": self.id},
5757
"data": {"name": name, "description": description},
5858
},
59+
experimental=True,
5960
)
6061

6162
data = result["editIssueCategory"]
@@ -78,5 +79,7 @@ def delete(self) -> bool:
7879
deleteIssueCategory(where: $where) { id }
7980
}"""
8081

81-
self.client.execute(query_str, {"where": {"id": self.id}})
82+
self.client.execute(
83+
query_str, {"where": {"id": self.id}}, experimental=True
84+
)
8285
return True

libs/labelbox/src/labelbox/schema/project.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,9 @@ def create_issue(
19161916
% _ISSUE_FIELDS
19171917
)
19181918

1919-
result = self.client.execute(query_str, {"data": mutation_data})
1919+
result = self.client.execute(
1920+
query_str, {"data": mutation_data}, experimental=True
1921+
)
19201922
return _parse_issue(self.client, result["createIssue"])
19211923

19221924
def get_issues(
@@ -1985,6 +1987,7 @@ def get_issues(
19851987
{"projectId": self.uid, "where": where}, # type: ignore[dict-item]
19861988
["project", "issues"],
19871989
lambda client, data: _parse_issue(client, data),
1990+
experimental=True,
19881991
)
19891992

19901993
def get_issue(self, issue_id: str) -> Issue:
@@ -2003,7 +2006,9 @@ def get_issue(self, issue_id: str) -> Issue:
20032006
% _ISSUE_FIELDS
20042007
)
20052008

2006-
result = self.client.execute(query_str, {"where": {"id": issue_id}})
2009+
result = self.client.execute(
2010+
query_str, {"where": {"id": issue_id}}, experimental=True
2011+
)
20072012
return _parse_issue(self.client, result["issue"])
20082013

20092014
def delete_issues(self, issue_ids: List[str]) -> bool:
@@ -2026,6 +2031,7 @@ def delete_issues(self, issue_ids: List[str]) -> bool:
20262031
self.client.execute(
20272032
query_str,
20282033
{"data": {"issueIds": issue_ids}},
2034+
experimental=True,
20292035
)
20302036
return True
20312037

@@ -2060,6 +2066,7 @@ def create_issue_category(
20602066
"description": description,
20612067
}
20622068
},
2069+
experimental=True,
20632070
)
20642071
data = result["createIssueCategory"]
20652072
return IssueCategory(

0 commit comments

Comments
 (0)