We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 871139a commit 9a12f87Copy full SHA for 9a12f87
labelbox/orm/query.py
@@ -40,12 +40,15 @@ def results_query_part(entity):
40
Args:
41
entity (type): The entity which needs fetching.
42
"""
43
+ # Query for fields
44
fields = [field.graphql_name for field in entity.fields()]
- for relationship in entity.relationships():
45
- if relationship.cache:
46
- fields.append(
47
- Query(relationship.graphql_name,
48
- relationship.destination_type).format()[0])
+
+ # Query for cached relationships
+ fields.extend([
+ Query(rel.graphql_name, rel.destination_type).format()[0]
49
+ for rel in entity.relationships()
50
+ if rel.cache
51
+ ])
52
return " ".join(fields)
53
54
0 commit comments