Skip to content

Commit 3d7d2b1

Browse files
committed
implemente helper to find out if links data can be fetched
1 parent 20f7215 commit 3d7d2b1

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

ayon_api/_api_helpers/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def log(self) -> logging.Logger:
2828
def is_product_base_type_supported(self) -> bool:
2929
raise NotImplementedError()
3030

31+
def links_graphql_support_data(self) -> bool:
32+
raise NotImplementedError()
33+
3134
def get_server_version(self) -> str:
3235
raise NotImplementedError()
3336

ayon_api/server_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ def __init__(
329329

330330
self._graphql_allows_traits_in_representations: Optional[bool] = None
331331
self._product_base_type_supported = None
332+
self._links_graphql_support_data = None
332333

333334
self._session = None
334335

@@ -922,6 +923,15 @@ def is_product_base_type_supported(self) -> bool:
922923
)
923924
return self._product_base_type_supported
924925

926+
def links_graphql_support_data(self) -> bool:
927+
"""Links data can be received by GraphQl."""
928+
if self._links_graphql_support_data is None:
929+
major, minor, patch, _, _ = self.server_version_tuple
930+
self._links_graphql_support_data = (
931+
(major, minor, patch) >= (1, 14, 2)
932+
)
933+
return self._links_graphql_support_data
934+
925935
def _get_user_info(self) -> Optional[dict[str, Any]]:
926936
if self._access_token is None:
927937
return None

0 commit comments

Comments
 (0)