Skip to content

Commit

Permalink
fix: don't query annotations resolver on LTS (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas1312 authored Nov 10, 2023
1 parent 851c161 commit 087b84b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/kili/adapters/kili_api_gateway/label/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from kili.core.graphql.graphql_client import GraphQLClient
from kili.domain.label import LabelId
from kili.domain.types import ListOrTuple
from kili.exceptions import GraphQLError

from .operations import get_annotations_query

Expand All @@ -28,5 +29,12 @@ def list_annotations(
video_transcription_annotation_fragment=fragment_builder(video_transcription_fields),
)
variables = {"where": {"labelId": label_id}}
result = graphql_client.execute(query, variables)

try:
result = graphql_client.execute(query, variables)
except GraphQLError as err:
if "Cannot query field" in str(err): # not available on LTS
return []
raise

return result["data"]

0 comments on commit 087b84b

Please sign in to comment.