Skip to content

Commit fab4d3c

Browse files
committed
added 'usedTags' to graphql fields
1 parent a98bce0 commit fab4d3c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ayon_api/_api_helpers/projects.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,27 +644,29 @@ def _get_project_graphql_fields(
644644
if len(fields - rest_list_fields) == 0:
645645
return graphql_fields, ProjectFetchType.RESTList
646646

647-
has_product_types = False
647+
must_use_graphql = False
648648
for field in tuple(fields):
649649
# Product types are available only in GraphQl
650-
if field == "productTypes":
651-
has_product_types = True
650+
if field == "usedTags":
651+
graphql_fields.add("usedTags")
652+
elif field == "productTypes":
653+
must_use_graphql = True
652654
fields.discard(field)
653655
graphql_fields.add("productTypes.name")
654656
graphql_fields.add("productTypes.icon")
655657
graphql_fields.add("productTypes.color")
656658

657659
elif field.startswith("productTypes"):
658-
has_product_types = True
660+
must_use_graphql = True
659661
graphql_fields.add(field)
660662

661663
elif field == "productBaseTypes":
662-
has_product_types = True
664+
must_use_graphql = True
663665
fields.discard(field)
664666
graphql_fields.add("productBaseTypes.name")
665667

666668
elif field.startswith("productBaseTypes"):
667-
has_product_types = True
669+
must_use_graphql = True
668670
graphql_fields.add(field)
669671

670672
elif field == "bundle" or field == "bundles":
@@ -696,7 +698,7 @@ def _get_project_graphql_fields(
696698
graphql_fields |= inters
697699
return graphql_fields, ProjectFetchType.GraphQl
698700

699-
if has_product_types:
701+
if must_use_graphql:
700702
graphql_fields.add("name")
701703
return graphql_fields, ProjectFetchType.GraphQlAndREST
702704

0 commit comments

Comments
 (0)