Skip to content

Commit 42dccb0

Browse files
authored
Remove hfid in upsert payload (#312)
1 parent e0d2622 commit 42dccb0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve node upsert performances

infrahub_sdk/node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,10 @@ async def create(
14181418
) -> None:
14191419
mutation_query = self._generate_mutation_query()
14201420

1421+
# Upserting means we may want to create, meaning payload contains all mandatory fields required for a creation,
1422+
# so hfid is just redondant information. Currently, upsert mutation has performance overhead if `hfid` is filled.
14211423
if allow_upsert:
1422-
input_data = self._generate_input_data(exclude_hfid=False, request_context=request_context)
1424+
input_data = self._generate_input_data(exclude_hfid=True, request_context=request_context)
14231425
mutation_name = f"{self._schema.kind}Upsert"
14241426
tracker = f"mutation-{str(self._schema.kind).lower()}-upsert"
14251427
else:

0 commit comments

Comments
 (0)