Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/535.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix branch handling in `_run_transform` and `execute_graphql_query` functions.
3 changes: 1 addition & 2 deletions infrahub_sdk/ctl/cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from ..schema import MainSchemaTypesAll, SchemaRoot
from ..template import Jinja2Template
from ..template.exceptions import JinjaTemplateError
from ..utils import get_branch, write_to_file
from ..utils import write_to_file
from ..yaml import SchemaFile
from .exporter import dump
from .importer import load
Expand Down Expand Up @@ -208,7 +208,6 @@ async def _run_transform(
debug: Prints debug info to the command line
repository_config: Repository config object. This is used to load the graphql query from the repository.
"""
branch = get_branch(branch)

try:
response = execute_graphql_query(
Expand Down
4 changes: 4 additions & 0 deletions infrahub_sdk/ctl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def execute_graphql_query(
query_str = query_object.load_query()

client = initialize_client_sync()

if not branch:
branch = client.config.default_infrahub_branch

response = client.execute_graphql(
query=query_str,
branch_name=branch,
Expand Down