File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1+ Respect default branch for client.query_gql_query() and client.set_context_properties()
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ def set_context_properties(
209209 delete_unused_nodes = delete_unused_nodes ,
210210 group_type = group_type ,
211211 group_params = group_params ,
212- branch = branch ,
212+ branch = branch or self . default_branch ,
213213 )
214214
215215 def _graphql_url (
@@ -1107,13 +1107,13 @@ async def query_gql_query(
11071107 ) -> dict :
11081108 url = f"{ self .address } /api/query/{ name } "
11091109 url_params = copy .deepcopy (params or {})
1110+ url_params ["branch" ] = branch_name or self .default_branch
1111+
11101112 headers = copy .copy (self .headers or {})
11111113
11121114 if self .insert_tracker and tracker :
11131115 headers ["X-Infrahub-Tracker" ] = tracker
11141116
1115- if branch_name :
1116- url_params ["branch" ] = branch_name
11171117 if at :
11181118 url_params ["at" ] = at
11191119
@@ -2247,13 +2247,13 @@ def query_gql_query(
22472247 ) -> dict :
22482248 url = f"{ self .address } /api/query/{ name } "
22492249 url_params = copy .deepcopy (params or {})
2250+ url_params ["branch" ] = branch_name or self .default_branch
2251+
22502252 headers = copy .copy (self .headers or {})
22512253
22522254 if self .insert_tracker and tracker :
22532255 headers ["X-Infrahub-Tracker" ] = tracker
22542256
2255- if branch_name :
2256- url_params ["branch" ] = branch_name
22572257 if at :
22582258 url_params ["at" ] = at
22592259 if subscribers :
You can’t perform that action at this time.
0 commit comments