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 (
@@ -1103,13 +1103,13 @@ async def query_gql_query(
11031103 ) -> dict :
11041104 url = f"{ self .address } /api/query/{ name } "
11051105 url_params = copy .deepcopy (params or {})
1106+ url_params ["branch" ] = branch_name or self .default_branch
1107+
11061108 headers = copy .copy (self .headers or {})
11071109
11081110 if self .insert_tracker and tracker :
11091111 headers ["X-Infrahub-Tracker" ] = tracker
11101112
1111- if branch_name :
1112- url_params ["branch" ] = branch_name
11131113 if at :
11141114 url_params ["at" ] = at
11151115
@@ -2242,13 +2242,13 @@ def query_gql_query(
22422242 ) -> dict :
22432243 url = f"{ self .address } /api/query/{ name } "
22442244 url_params = copy .deepcopy (params or {})
2245+ url_params ["branch" ] = branch_name or self .default_branch
2246+
22452247 headers = copy .copy (self .headers or {})
22462248
22472249 if self .insert_tracker and tracker :
22482250 headers ["X-Infrahub-Tracker" ] = tracker
22492251
2250- if branch_name :
2251- url_params ["branch" ] = branch_name
22522252 if at :
22532253 url_params ["at" ] = at
22542254 if subscribers :
You can’t perform that action at this time.
0 commit comments